No description
Find a file
George Lemon 02d30bc2ad update
Signed-off-by: George Lemon <georgelemon@protonmail.com>
2025-12-13 07:02:36 +02:00
.github update 2025-11-04 03:25:43 +02:00
src update 2025-12-13 07:02:36 +02:00
tests update 2025-12-13 07:02:36 +02:00
.gitignore Initial commit 2025-09-12 13:29:08 +03:00
LICENSE Add MIT License to the project 2025-09-15 11:56:00 +03:00
marvdown.nimble update 2025-12-13 07:02:36 +02:00
README.md update 2025-11-28 16:34:06 +02:00


This is Marvdown A stupid simple Markdown parser

nimble install marvdown / npm install @openpeeps/marvdown

API reference | Download

Github Actions Github Actions

Note

Marv is still in early development. Some features are not fully implemented yet. Contributions are welcome!

😍 Key Features

  • Extremely Fast & Lightweight! Check benchmarks
  • Compiled cross-platform CLI app
  • Nim library for easy integration in your 👑 Nim projects
  • Addon for Node.js JavaScript runtime via N-API
  • Markdown to HTML
    • Auto-generate Table of Contents (ToC)
    • Auto-generate heading IDs for anchor links
  • Markdown to PDF
  • Markdown to JSON (structured data)
  • GitHub Flavored Markdown (GFM)

About

Marv is a stupid simple markdown parser written in Nim. It can be used as a library in your Nim projects or as a CLI tool to convert markdown files to HTML. Currently, it supports basic markdown syntax like headings, paragraphs, bold, italic, links, images, lists, blockquotes, code blocks and inline code.

Installing

Install Marvdown via Nimble

nimble install marvdown

For Node.js install Marvdown via npm

A GitHub action will build the binary CLI app and Node.js addon evertime a new release is published. Download the latest version of Marvdown from the Github releases page.

Example Usage

Using Marvdown from the command line is super easy. Just run:

marvdown html sample.md --optAnchors --bench

Enable anchor generations for headings with --optAnchors flag. Run benchmarks with --bench flag.

Programming with Marvdown

In Nim language the fastest way to convert markdown to HTML is to use the toHtml() proc.

import marvdown

echo marvdown.toHtml(readFile("sample.md"))

In JavaScript or TypeScript you can load the N-API addon and use the toHtml() function.

const fs = require('fs');
const marvdown = require('@openpeeps/marvdown')

let output = marvdown.toHtml(fs.readFileSync('sample.md', 'utf8'))
console.log(output)

todo: example of custom options

For more examples, see the /examples folder. Also check out the API reference for more details 👌

Benchmarks

Marvdown is super fast! It can parse large markdown files in milliseconds. Here is a quick benchmark over 100K lines of markdown text (~5.3 MB)

Benchmark 1: marvdown html bigdoc.md
  Time (abs ≡):        188.1 ms               [User: 166.9 ms, System: 19.8 ms]

Benchmark made with hyperfine

❤ Contributions & Support

Credits

Original illustration made by 💙 Olha remixed with Sora.

🎩 License

Marv | MIT License. Made by Humans from OpenPeeps.
Copyright © 2024 OpenPeeps & Contributors — All rights reserved.