markast
v0.1.2
Published
Rust-powered markdown to HTML renderer with customizable styles
Downloads
28
Readme
markast
markast is a Rust Markdown renderer distributed through npm.
By default it outputs HTML fragments like marked.
It can also output a full HTML document with built-in or custom styles.
Install
npm i -g markastUsage
Render Markdown to HTML fragment (default):
markast README.md > out.html
cat README.md | markastRender full HTML document with built-in theme:
markast --document --theme github README.md > page.html
markast --document --theme dracula README.md > page.html
markast --document --theme paper README.md > page.htmlApply custom style definition (JSON):
markast --document --theme-file theme.json README.md > page.htmltheme.json format:
{
"variables": {
"--markast-bg": "#0f1115",
"--markast-fg": "#f2f5f9",
"--markast-link": "#65c1ff"
},
"css": ".markast h1 { letter-spacing: 0.02em; }"
}Append extra CSS file:
markast --document --css ./extra.css README.md > page.htmlDevelopment
npm run check
npm run check:strict
npm run test:own
npm run test:compat:snapshot
npm run test:compat:runtime
npm run test:compat
npm run test:compat:report
npm run buildParser engine:
Current default and only production parser is the in-house markdown module (new parser pipeline), with no external markdown engine dependency in the main crate.
Development docs:
docs/README.mddocs/architecture.mddocs/testing-and-compat.mddocs/performance.mddocs/requirements.md
Compatibility fixtures are synced under third_party/marked/test/specs.
Compat now has two layers:
npm run check:strict: runs Rust compile/test gates with warnings denied.npm run test:compat:snapshot: gated comparison against vendored marked fixture/spec snapshots.npm run test:compat:runtime: gated comparison against the current vendoredmarkednpm runtime.npm run test:compat:runtime-drift: auxiliary audit that checks whether snapshot-xfailed vendored fixtures still match the current runtime.npm run test:compat: runs both in sequence.
Known snapshot gaps are tracked in tests/compat/xfail.yaml.
Known runtime gaps are tracked in tests/compat/runtime_xfail.yaml.
Refresh the snapshot xfail baseline after intentional parser behavior changes:
npm run test:compat:snapshot:update-xfailRefresh the runtime xfail baseline after intentional parser behavior changes:
npm run test:compat:runtime:update-xfailCompatibility Report
Current report date: 2026-03-16
This table compares the same parser-output cases from the official marked corpus under third_party/marked/test/specs.
Included in the same-case comparison:
new+originalfixture pairs: 153- CommonMark JSON examples: 652
- GFM CommonMark mirror examples: 652
- GFM spec examples: 28
- Total comparable cases: 1485
Excluded from this table:
third_party/marked/test/unit/*.test.js: 158 JS unit cases. These exercise Marked's JS API surface such as hooks, lexer/parser classes, CLI integration, and instance behavior, so there is no 1:1 Rust-side case mapping inmarkastyet.third_party/marked/test/specs/redos: 7 ReDoS fixtures. These are security/performance-oriented fixtures and are not currently part of themarkastcompat gates.
| Target | Case source | Passed | Gaps | Pass rate |
| --- | --- | ---: | ---: | ---: |
| marked self-spec result | vendored marked fixture/spec corpus | 1485 | 0 | 100.0% |
| markast snapshot compat | vendored fixture/spec snapshots | 1327 | 158 | 89.4% |
| markast runtime compat | current [email protected] runtime | 1479 | 6 | 99.6% |
How to refresh:
npm run test:compatnpm run test:compat:report
Benchmark
Reproduce locally:
npm install
npm run benchThe harness benchmarks shared Markdown corpora against five engines:
markastthrough an in-process Rust benchmark binarypulldown-cmarkthrough a benchmark-only comparison runnermarkedthroughmarked.parse(...)markdown-itthroughmarkdown-it.render(...)remarkthroughremark + remark-gfm + remark-html
CommonMark Core is the fairest suite for pulldown-cmark, because it runs the official CommonMark examples with gfm=false.
Raw data is written to bench/results/latest.json.
Performance strategy and optimization batches live in docs/performance.md.
pulldown-cmark is included as a throughput ceiling reference. markast is not expected to match its architecture or semantics in Phase 1.
The pulldown-cmark comparator is kept outside the main markast crate so release/runtime dependencies stay focused on the in-house parser.
Benchmark date: 2026-03-13
Method: in-process render throughput on the same default-GFM corpus for all engines. Outputs are not normalized for semantic equality; this report only measures rendering speed on shared inputs. Trimmed mean ms drops one run from each side for 6-9 samples, or 10% from each side for 10+ samples.
Environment: Apple M4 | darwin 24.6.0 (arm64) | Node 22.22.1 | Rust rustc 1.93.0 (254b59607 2026-01-19)
| Suite | Docs | Input size | Warmup | Measured | Source |
| --- | ---: | ---: | ---: | ---: | --- |
| README.md | 1 | 7.2 KiB | 10 | 30 | Project README rendered as a single document |
| CommonMark Core | 652 | 14.6 KiB | 4 | 10 | Official CommonMark 0.31.2 JSON examples rendered in non-GFM mode |
| Marked Fixtures | 153 | 58.3 KiB | 4 | 12 | new + original fixture pairs from vendored marked specs |
| Comparable Corpus | 1485 | 88.9 KiB | 4 | 12 | All 1485 comparable parser-output cases from vendored marked specs |
| Suite | Engine | Trimmed mean ms | Median ms | Docs/s | MiB/s | vs marked | | --- | --- | ---: | ---: | ---: | ---: | ---: | | README.md | markast (Rust) | 0.24 | 0.24 | 4116.9 | 29.02 | 1.64x | | README.md | pulldown-cmark (Rust) | 0.05 | 0.05 | 21819.0 | 153.79 | 8.71x | | README.md | marked (JS) | 0.40 | 0.39 | 2506.1 | 17.66 | 1.00x | | README.md | markdown-it (JS) | 0.47 | 0.46 | 2133.9 | 15.04 | 0.85x | | README.md | remark + gfm + html | 5.40 | 5.20 | 185.0 | 1.30 | 0.07x | | CommonMark Core | markast (Rust) | 1.23 | 1.20 | 529408.8 | 11.55 | 1.62x | | CommonMark Core | pulldown-cmark (Rust) | 0.52 | 0.51 | 1258143.2 | 27.46 | 3.85x | | CommonMark Core | marked (JS) | 1.99 | 1.93 | 327005.7 | 7.14 | 1.00x | | CommonMark Core | markdown-it (JS) | 2.33 | 2.26 | 280410.0 | 6.12 | 0.86x | | CommonMark Core | remark + gfm + html | 29.32 | 28.71 | 22234.4 | 0.49 | 0.07x | | Marked Fixtures | markast (Rust) | 3.24 | 3.17 | 47214.0 | 17.56 | 1.41x | | Marked Fixtures | pulldown-cmark (Rust) | 0.59 | 0.59 | 259931.5 | 96.69 | 7.77x | | Marked Fixtures | marked (JS) | 4.57 | 4.57 | 33466.2 | 12.45 | 1.00x | | Marked Fixtures | markdown-it (JS) | 3.69 | 3.64 | 41492.2 | 15.43 | 1.24x | | Marked Fixtures | remark + gfm + html | 47.08 | 46.84 | 3250.1 | 1.21 | 0.10x | | Comparable Corpus | markast (Rust) | 4.41 | 4.41 | 336770.0 | 19.69 | 1.90x | | Comparable Corpus | pulldown-cmark (Rust) | 1.23 | 1.20 | 1206282.9 | 70.52 | 6.80x | | Comparable Corpus | marked (JS) | 8.37 | 8.37 | 177508.4 | 10.38 | 1.00x | | Comparable Corpus | markdown-it (JS) | 6.94 | 6.90 | 213845.0 | 12.50 | 1.20x | | Comparable Corpus | remark + gfm + html | 140.03 | 140.38 | 10604.6 | 0.62 | 0.06x |
Raw benchmark data: bench/results/latest.json
Release
Push a semver tag like v0.1.0.
GitHub Actions workflow .github/workflows/release.yml will:
- Build each platform binary.
- Pack and publish platform npm packages.
- Publish the main package
markast.
