You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be quite nice if aside from a play-button the rust source blocks would offer an expand macros-button that just does that through the playground. I am not sure whether this is possible to get into mdbook so that has to be figured out.
The text was updated successfully, but these errors were encountered:
Hi @Veykril, I i opened a PR implementing your idea rust-lang/mdBook#1343 you can check the discussion there if you want to add your opinion.
Personally I think cargo-expand is too verbose, and adding selected snippets where needed is a good enough way (like its already done in some sections of the book).
Also at least the book does mentions rust play ground macro expand function.
Ye I would've guessed that adding something like that upstream to mdbook itself wouldn't work out. I mainly put this issue up for tracking the idea as it could be nice. It's not that important but I'll leave this up anyways, maybe someone wants to work on it when bored.
The two options I'd see, similar to what ehuss said in the PR:
Either build the expanded output for examples at build time somehow, and include them via spoilers in the output html with some css/js fiddling.
Send an expand request to the playground with additional-js etc.
It would be quite nice if aside from a
play
-button the rust source blocks would offer anexpand macros
-button that just does that through the playground. I am not sure whether this is possible to get into mdbook so that has to be figured out.The text was updated successfully, but these errors were encountered: