Computer Flavored Markdown
CommonMark
The biggest part of Computer Flavored Markdown is Markdown. Specifically, CFM is mostly just CommonMark. So this all works:
Extensible HTML tags
In normal Markdown, whenever you write inline HTML, it's passed through to the output verbatim. But in Computer Flavored Markdown, it's parsed and can be transformed during compilation.
Let's use the <table-of-contents />
tag as an example. This is not an HTML tag, but it has meaning in Computer Words because of the table_of_contents
plugin. If you write this:
it will be transformed during compilation and rendered like this:
The means by which this happens is described later.
Parser caveats
Bugs
If you want to put multiple paragraphs inside a tag, the opening and closing tags must be in their own lines.
This works:
This does not work:
There are also more bugs. This works:
This does not work:
This also does not work:
This is because I have bolted a CommonMark parser, which doesn't really understand HTML, to an HTML parser of my own design. I'm still working out the bugs. You should still be able to express anything if you mess with the line breaks a little.
The parser is too picky
If you try to use your Github Flavored Markdown files, a lot of them won't work because Computer Flavored Markdown throws errors in too many cases instead of passing strings through verbatim when it can't parse them.
If you have a good example of this, please open a ticket on GitHub.
Tags must have explicit open/close or be self-closing
Any time you use a tag, it needs to either be of the form <my-tag>contents</my-tag>
or <my-tag />
. Using <my-tag>
by itself will result in an error.