3 ms·
I really like this, I imagine it would be really helpful if you were writing a book/blog post, you could "print" the code you were using as an example, then "ru
by onaclov2000 12y ago
I really like this, I imagine it would be really helpful if you were writing a book/blog post, you could "print" the code you were using as an example, then "run" it and output all of that into your generated HTML, this would ensure you have a "working" example at all times.
- captn3m0 12y agoThis reminds me of how the Angular team tests their documentation. All code inside the documentation is unit tested trivially, and thus guarantees that the documentation is always correct.
- Nullabillity 12y agoA while ago I wrote something similar (though only for Scala) for a school project. It would basically fake a REPL session, which had the con of being pretty tightly coupled to the language, but it would give you nice automatic output that would match what the user would get. Example: http://www.kodknackning.se/gettingstarted/types http://www.kodknackning.se/gettingstarted/types Source: https://github.com/teozkr/scala-repl-sampler https://github.com/teozkr/scala-repl-sampler