README (1366B) [raw]
1 # `nihdoc` 2 3 Not Invented Here Doc 4 - - - --- 5 6 > "because markdown isn't in base!" 7 > 8 > ~akarle 9 10 11 ## Description 12 13 `nihdoc` is my take at a light markup language to improve my 14 time-to-publish on blog posts. I concede up front that others 15 should likely use markdown, which is both prettier and more 16 well-known, but as a personal challenge I try to keep my blog 17 publishable under *only the OpenBSD base system*. Since there's 18 no markdown parser in base, I had to write my own! 19 20 Probably the most interesting feature is that it's is a streaming 21 parser using only constant space. In other words, it only reads 22 the input once, never scans, and doesn't store the input in 23 memory. You can see this if you run it interactively: `cat | nihdoc`. 24 25 ## Usage 26 27 `nihdoc` reads from stdin and prints HTML snippets to stdout. No 28 arguments are read and no files are accessible (on OpenBSD this 29 is enforced via pledge(2)). Common usage is: 30 31 $ (cat header.html; nihdoc < file.txt; cat footer.html) > file.html 32 33 ## Support 34 35 - #|##|### headers 36 - <p> tags around paragraphs (allowed to wrap!) 37 - - bullets, breaks allowed if indented 38 - 1. numerical lists, breaks allowed if indented 39 - > quotes 40 - TAB code blocks 41 - Inline `code`, _italics_, and *bold* 42 - Escaping via \\ 43 - Links: [my site](https://alexkarle.com) or [https://alexkarle.com] 44 45 ## TODO 46 47 - Mixed lists