lit icon indicating copy to clipboard operation
lit copied to clipboard

output documentation instead of code

Open vijithassar opened this issue 5 years ago • 0 comments

So far lit always assumes your intention is to build the Markdown source into executable code, but there are also cases where isolating the documentation is useful – publishing a user manual on the web site for a project, for example. Such efforts are very much in line with the goals of lit and literate program, though the "last mile" problem of actually exposing the documentation is obviously best left to other tools.

For these scenarios, it'd be useful for lit to accept a command line flag which inverts its usual behavior, sending documentation to the output and ignoring the code, or perhaps even retaining it but commenting it out.

This should be relatively easy to implement – just offset the awk comparison by 1 to invert the blocks that are captured from the input. (That link points to the compiled output script rather than the literate source, because unfortunately GitHub has no way to link to a specific line of Markdown!)

vijithassar avatar Sep 19 '18 21:09 vijithassar