commonmark
gleam add commonmark
import commonmark
import gleam/io
pub fn main() {
"# Hello, Gleam!
This is a test."
|> commonmark.render_to_html
|> io.println
// -> "<h1>Hello, Gleam!</h1>\n<p>This is a test.</p>\n"
}
Further documentation can be found at https://hexdocs.pm/commonmark.
You can view this README as an AST here.
There is also an interactive demo which you can use to test how this library interacts with your documents.
Syntax support
[!WARNING] 🚧 This package is still heavily under construction 🚧
Legend
- ✅ - Completed
- 🚧 - In Progress
- ❌ - Unsupported
CommonMark
The current version of CommonMark targetted is 0.31.2.
- ✅ Thematic breaks
- ✅ ATX headings
- ✅ Setext headings
- ✅ Indented code blocks
- ✅ Fenced code blocks
- ❌ Link reference definitions
- ✅ Paragraphs
- ✅ Block quotes
- 🚧 Ordered lists
- 🚧 Unordered lists
- ✅ Code spans
- 🚧 Emphasis and strong emphasis
- 🚧 Links
- 🚧 Images
- ✅ Autolinks
- ✅ Hard line breaks
- ✅ Soft line breaks
Raw HTML features will be tackled last as the potential security issues around this need to be considered.
- ❌ HTML blocks
- ❌ Inline HTML
Github Flavoured Markdown
The current version of GFM targetted is 0.29-gfm.
- ❌ Tables
- ✅ Strikethrough
Other extensions
Development
gleam test # Run the tests
gleam run -m tools/benchmark # Run the benchmarks
gleam run -m tools/codegen # Run the codegen tasks (these are committed in the repo)
gleam shell # Run an Erlang shell