Markdown-to-html in pure awk
030c80da6a
According to the POSIX standard[0], the length() function only supports strings. Although most common awk implementations support array length() as an extension[1], it is better to make the program portable. GNU Awk has a --posix flag that ensures that the script is POSIX compliant. Running markdown.awk with this flag results in an error. This can be fixed by getting the length of the array returned by split(). [0]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html [1]: https://www.gnu.org/software/gawk/manual/html_node/Common-Extensions.html |
||
---|---|---|
LICENSE | ||
markdown.awk | ||
README.md | ||
test.sh |
A markdown-to-html in pure awk
This awk script reads markdown files and generates html from them. Compared to other implementations of markdown in awk, it tries to do the right thing most of the time.
You can use markdown.awk
to generate html pages from your plaintext notes, or send html emails with mutt.
This is a work in progress
Usage
You can try it out by converting this readme to html:
awk -f markdown.awk README.md
Features
Here's a list of supported markdown primitives
- Headers
- Paragraphs
- Text formatting: bold/italic
- Code blocks
- Blockquotes
- Lists, both bulleted and numbered
- Inline html (partial)
- Links
- Images
- Tables
License
Distributed under the terms of the BSD License