Current section
Files
Jump to
Current section
Files
commonmark
README.md
README.md
# commonmark
[](https://hex.pm/packages/commonmark)
[](https://hexdocs.pm/commonmark/)


```sh
gleam add commonmark
```
```gleam
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.][readme-ast]
There is also an [interactive demo][demo] which you can use to test how this library interacts with your documents.
[readme-ast]: https://github.com/mscharley/gleam-commonmark/tree/main/birdie_snapshots/common_mark_readme.accepted
[demo]: https://mscharley.github.io/gleam-commonmark/
## Syntax support
π§ This package is still heavily under construction π§
β
- Completed | π§ - In Progress | β - Unsupported
### CommonMark
The current version of CommonMark targetted is [0.31.2][commonmark].
* β
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
[commonmark]: https://spec.commonmark.org/0.31.2/
### Github Flavoured Markdown
The current version of GFM targetted is [0.29-gfm][gfm].
* β Tables
* β Strikethrough
[gfm]: https://github.github.com/gfm/
## Development
```sh
gleam test # Run the tests
gleam shell # Run an Erlang shell
```