Invert markdown annotated source code to code describing markdown documentation
Huub de Beer
Install incodoc by:
npm install -g incodoc
- it starts with a line containing only /**, excluding whitespace,
- it ends with a line containing only * immediately followed by /, excluding whitespace,
- every line in between starts with a *, possibly preceded by some whitespace.
Everything outside a markdown documentation block is recognized as a code block.
The most simplest usage is:
incodoc file1 file2 ... fileN
That command inverts all files listed and places the generated documentation in the current working directory.
If you want, you can enable linenumbers in code blocks as well as choose another highlighting style via, for example:
incodoc -l -h monochrome file1
This will show linenumbers as well as choose the monochrome style. Possible styles are:
If another output format is desired, you can select
- 'plain', '
as well through the
Finally, you can specify a special CSS stylesheet via the
-s option. If no stylesheet is specified, the generated HTML file points to