markdown -
A markdown parser for Nit.
Markdown documentation can be found in http://daringfireball.net/projects/markdown/. This parser is inspired by the famous TxtMark for Java (https://github.com/rjeschke/txtmark).
Usage
nitmd
can be used as a standalone tool:
$ nitmd file.md
Or you can use it programmatically by importing the markdown
module.
Differences with Markdown specification
This parser passes all tests inside http://daringfireball.net/projects/downloads/MarkdownTest_1.0_2007-05-09.tgz execpt of two:
- Images.text: fails because this parser doesn't produce empty 'title' image attributes.
- Literal quotes in titles.text: because markdown accepts unescaped quotes in titles and this is wrong.
Testing
The NitUnit test suite can be found in test_markdown.nit
.
Minimalists tests are prefixed with process_*
. All tests from daringfireball are prefixed with process_daring*
.
Run the test suite:
$ nitunit lib/markdown/markdown.nit -t lib/markdown/test_markdown.nit
Content
- markdown: A markdown parser for Nit. (lib/markdown)
- decorators: Decorators for
markdown
parsing. (lib/markdown/decorators.nit) - man: Simple groff decorator restricted for manpages. (lib/markdown/man.nit)
- markdown: Markdown parsing. (lib/markdown/markdown.nit)
- nitmd: A Markdown parser for Nit. (lib/markdown/nitmd.nit)
- test_markdown: Test suites for module
markdown
(lib/markdown/test_markdown.nit) - test_wikilinks: Test suites for module
markdown
(lib/markdown/test_wikilinks.nit) - wikilinks: Wikilinks handling. (lib/markdown/wikilinks.nit)
- decorators: Decorators for