nmark

fast markdown parser

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install nmark
choosenim install nmark
git clone https://github.com/kyoheiu/nmark

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
nmark - - - - - - -

Source

Repository https://github.com/kyoheiu/nmark
Homepage https://github.com/kyoheiu/nmark
Registry Source nimble_official

README

nmark

Fast markdown converter, based on CommonMark, written in Nim.

Usage

import nmark

let txt = """
> Lorem ipsum dolor
sit amet.
> - Qui *quodsi iracundia*
> - aliquando id
"""

echo txt.markdown

...and it's done.

# output
<blockquote>
<p>Lorem ipsum dolor
sit amet.</p>
<ul>
<li>Qui <em>quodsi iracundia</em></li>
<li>aliquando id</li>
</ul>
</blockquote>

table

You can use tables in nmark.

| abc | defghi |
:-: | -----------:
bar | baz

is converted to:

<table>
<thead>
<tr>
<th align="center">abc</th>
<th align="right">defghi</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">bar</td>
<td align="right">baz</td>
</tr>
</tbody>
</table>

(Tables need to be separated from other blocks by empty line.)

Performance comparison

One of the reason I'm working on this is that other markdown librarys written in Nim seemed relatively slow. Here is a comparison between nim-markdown, which I think is the standard Nim markdown parser, and nmark, through a static site generator(which, btw, I made) and hyperfine.

Perfomance comparison detail

As shown above, with nmark it is about 4 times faster than with nim-markdown for now.

Caution

This is still work-in-progess project, and does not FULLY pass the spec-test of CommonMark. For example,

> foo
bar
===

is, by nmark, converted to:

<blockquote>
<h1>foo
bar</h1>
</blockquote>

I'm working on improving the accuracy and performance. Issues, pull requests always welcome.