Skip to content
erlsciPublic

About

An implementation of markdown written in Erlang

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

erlmd

Erlang Markdown parser with HTML and AST output (erlmarkdown fork)

About

  • Original library (erlmarkdown): Focused on Markdown → HTML conversion, preserved with community improvements in the branch release/1.1.x
  • This fork (erlsci/erlmd): Added support for Markdown → AST (Abstract Syntax Tree) - release/1.2.x

Installation

Add to your rebar.config:

{deps, [
    {erlmd, "1.2.0"}
]}.

Usage

Markdown to HTML

1> erlmd:conv("# Hello *World*").
"<h1>Hello <em>World</em></h1>"

2> erlmd:conv("- Item 1\n- Item 2").
"<ul>\n<li>Item 1</li>\n<li>Item 2</li>\n</ul>"

Markdown to AST

1> AST = erlmd:conv_ast("# Hello *World*").
{document,[{header,1,
                   [{text,"Hello "},{emphasis,[{text,"World"}],42}],
                   atx}]}

2> erlmd:conv_html(AST).
"<h1>Hello <em>World</em></h1>"

% Or use the options API
3> erlmd:conv("# Hello\n\n- Item 1\n- Item 2\n\n", #{format => ast}).
{document,[{header,1,[{text,"Hello"}],atx},
           {blank_line},
           {list,ul,
                 [{list_item,[{paragraph,[{text,"Item 1"}]}],true},
                  {list_item,[{paragraph,[{text,"Item 2"}]}],true}],
                 true}]}

Documentation

License

Same as the original Markdown (BSD-style). See the Daring Fireball project for details.

About

An implementation of markdown written in Erlang

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages