3 ms·
Include markdown files into other markdown files with C style syntax
- a3n 10y agoNot to take away from this (I'd probably use it if I used markdown), but RestructuredText has file inclusion out of the box. http://docutils.sourceforge.net/docs/ref/rst/directives.html#including-an-external-document-fragment http://docutils.sourceforge.net/docs/ref/rst/directives.html... $ for f in main.rst include1.rst include1.1.rst; do echo "$f" cat "$f" done main.rst ================================== Demo of RestructuredText inclusion ================================== .. contents:: First include a file ==================== .. include:: include1.rst include1.rst This is the first included file ------------------------------- Which includes another file. .. include:: include1.1.rst include1.1.rst And this is the last included file .................................. Fin. $ lynx --dump main.html Demo of RestructuredText inclusion Contents * [1]First include a file + [2]This is the first included file o [3]And this is the last included file [4]First include a file [5]This is the first included file Which includes another file. [6]And this is the last included file Fin. References 1. file:///home/aaron/tmp/main.html#first-include-a-file 2. file:///home/aaron/tmp/main.html#this-is-the-first-included-file 3. file:///home/aaron/tmp/main.html#and-this-is-the-last-included-file 4. file:///home/aaron/tmp/main.html#id1 5. file:///home/aaron/tmp/main.html#id2 6. file:///home/aaron/tmp/main.html#id3
- jdormit 10y agoI am not the author of this library, but I've found it to be incredibly useful putting together documentation for GitHub/GitLab repos. If you're working with JavaScript, this library combines really nicely with jsdoc-to-markdown [1] to completely automate API documentation in the README.md (see [2] for an example). [1] https://github.com/jsdoc2md/jsdoc-to-markdown https://github.com/jsdoc2md/jsdoc-to-markdown [2] https://github.com/sparkeditor/piece-table https://github.com/sparkeditor/piece-table