A Markdown compiler for the people.
- Stable - Marx uses semantic versioning, and will not break underneath you when bumping a patch version
- Extensible - Need to manipulate the output of Marx? You can hook into any stage of processing
- Minimal - Marx does not have any dependencies. Its aim is be a low-level library that can be used in Elixir itself
Supports CommonMark Version 0.30
Marx aims to be compliant with the CommonMark specification. Thus, a test suite
against the entire CommonMark specification is included via MarxConformanceTest
.
Each test in the CommonMark test suite is taken from the numbered examples in the spec. To run a specific test, each test is tagged with the example number.
# Run the test for example five in the CommonMark spec
$ mix test --only example:5
- Clone the CommonMark spec
- Run
python3 test/spec_tests.py --dump-tests > test/support/commonmark_suite.json
graph TD
string --> Marx.Block.Parser
Marx.Block.Parser -->|list of blocks| Marx.Block.TreeParser
Marx.Block.TreeParser -->| Partial Markdown AST| Marx.Line.Parser
Marx.Line.Parser -->|Full Markdown AST| Marx.AST.Renderer
Marx.AST.Renderer -->|html| HTML
If available in Hex, the package can be installed
by adding marx
to your list of dependencies in mix.exs
:
def deps do
[
{:marx, "~> 0.1.0"}
]
end