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>.
## 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
```