CommonMark superset with the most widely used syntax extensions
ExtraMark is a superset of CommonMark that includes syntax extensions that are commonly used by other Markdown dialects. The list and syntax for the extensions are decided by looking at the most popular Markdown dialects and selecting the most common syntax for each feature. The goal of the project is to create a (somewhat) standard superset of CommonMark that supports the features that are requested by most. The parser is based on markdown-it and uses plugins for syntax extensions.
npm install extramark
Load from a CDN:
extramark package exposes two functions,
parse() function creates an abstract syntax tree from the input while the
render() function returns the generated HTML code (see markdown-it).
const parse render = ;;// [Object] - AST of the Markdown code;// <h1>Heading</h1>
In a browser environment you can access the
render() functions via the
ExtraMark global object.
const parse render = ExtraMark;
To transform documents in the command line you have to install the
extramark package globally.
npm install -g extramark
After the installation the
extramark command becomes available. The command can be used to transform the input text (file or
stdin) to HTML (file or
extramark input.md -o output.html -c style.css
To see all options of the
extramark see it's help:
- Defined clearly as a superset of CommonMark
- Syntax extensions
- Integrated CLI tool for command-line conversion to HTML
All ideas, recommendations, bug reports, pull requests are welcome. 😄