Closed jonathanpallant closed 1 year ago
I feel it is alright to include the full version if we want users to be able to run it. If we want only the first one, I would remove the Run button. I also do not want to hack any JS to add the fn main()
part.
One other idea is to include a playground link at the bottom of each code snippet, and remove the Run button from code snippet. That way folks get a succinct code version with a link to playground to run it.
mdbook supports the idea of hiding lines of code by prefixing them with #
, but I don't know how we'd teach highlight.js about this.
Maybe it's best to just make the examples fully runnable. Saves the trainer having to manually add the fn main() {
and }
after they've opened the playground.
I vote for full. two extra lines for runnable code yea i am ok with that.
Agreed
This works in mdbook and mdslides:
It will pass the tests. However, if you load it into the playground with the RUN button it won't work.
The playground requires you write it out in full:
Which is better?