#markdown-parser #wasm-build #svelte #browser #package #front-end

bin+lib md_parser_wasm

A markdown parser written in Rust and compiled to WebAssembly

2 releases

0.3.5 Mar 1, 2024
0.3.4 Mar 1, 2024

#8 in #svelte

MIT license

1MB
641 lines

Markdown Parser (WIP)

Simple Markdown parser in rust which is compiled to wasm and presented to browser with svelte

To build just the rust part

  • cargo build
  • wasm-pack build

Run rust tests

cargo test

To setup frontend

cd web and yarn or npm install

To run everything after compiling to wasm

cd web and yarn dev

Currently supports parsing

  • unordered lists
  • ordered lists
  • simple texts
  • Headings (#, ##, ###)
  • Bold text, **text**
  • Code `code`
  • Anchor Links (x)[y]

Using through CLI

md_parser is also available as a CLI tool

USAGE:

md_parser_wasm --file <input_file>

Using as an npm package

This is also published as an npm package. Can be used in frontend projects using

npm i -S wasm_md_parser

Preview

preview

Demo

demo

Dependencies

~11–14MB
~251K SLoC