Unlike LaTeX's core, CONTEXT core macros have quite readable code and, specially in the lack of up-to-date documentation for certain commands, one can learn a lot by just reading the code itself and the documentation provided therein. That's also a good source of learning how to write CONTEXT macros.
In fact, there is a way to generate documentation right from the code itself, which adds the provided annotations to the PDF output along with the actual code. According to Garden, this is done via the following command line.
context --ctx=s-mod core-con.mkiv
This generates a core-con.mkiv.prep
file and also compiles it into a nice PDF output.
How does the same functionality work for Lua files? The same page on Garden suggests the following.
context --ctx=x-ldx core-con.lua
This generates a core-con.lua.prep
and then a core-con.lua.prep.prep
file but not the desired supposedly HTML documentation. Question: What am I doing wrong here?
Question: What tags beside the \module
definition at the top and the index mechanism \macros
can we use inside the %D
comments (in MkIV sources)? (I know we can use any TeX code; I'm asking what special macros are available.) I also notice a special %C
tag for the copyright statement but don't know what effect it has. Are there any other special comment codes?
Question: What about the tags in the Lua file? Those are more mysterious and scarcer. Why are these HTML tags, anyway, instead of TeX macros?