3 ms·
I think the binding is really the big thing here. That basically the whole module environment is also available to scribble since it is also legitimate code, an
by makmanalp 13y ago
I think the binding is really the big thing here. That basically the whole module environment is also available to scribble since it is also legitimate code, and it's being executed by the same interpreter, in essence.
I'm unconvinced that this is not possible otherwise though. If you're parsing the darn language to get to the AST to generate all the module names, contents, etc, I don't see why you couldn't have access to all that info when generating an example code block.
Example:
http://wtf.tw/etc/pygments/pygments/formatters/html.py.html http://wtf.tw/etc/pygments/pygments/formatters/html.py.html
Although I don't know why it's not more common.
- samth 13y agoRight, people have certainly implemented hyperlinked versions of code by re-implementing the parser etc. LXR is an excellent example of this. What sets Scribble apart is that * It's a documentation system, not just a code formatter. * It's a programmable documentation system, and the code that _implements_ your documentation is kept appropriately separate from the code that you are documenting. This makes use of Racket's support for phases. * That it doesn't re-implement the parser etc, but can use the built-in one, because of Racket's macros. And, as you say, even if none of this was unique, there's the fact that Racket does it, and has 500k lines of documentation, all done comprehensively in this style.