Skip to content

davydog187/marx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marx

A Markdown compiler for the people.

Goals

  • 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

Markdown flavors

Supports CommonMark Version 0.30

Extensions

Development

Marx aims to be compliant with the CommonMark specification. Thus, a test suite against the entire CommonMark specification is included via MarxConformanceTest.

Running a specific conformance example

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

Updating the conformance test suite

  1. Clone the CommonMark spec
  2. Run python3 test/spec_tests.py --dump-tests > test/support/commonmark_suite.json

Architecture

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
Loading

Installation

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

About

A markdown compiler for the people

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages