|
|
||
|---|---|---|
| .github | ||
| src | ||
| tests | ||
| .gitignore | ||
| LICENSE | ||
| marvdown.nimble | ||
| README.md | ||

This is Marvdown ⚡️ A stupid simple Markdown parser
nimble install marvdown / npm install @openpeeps/marvdown
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
- 🐛 Found a bug? Create a new Issue
- 👋 Wanna help? Fork it!
- 😎 Get €20 in cloud credits from Hetzner
- 🥰 Donate to OpenPeeps via PayPal address
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.