cargo doc for JavaScript
Rust-powered document generator and high-performance Markdown toolkit
Documentation • Getting Started • Playground • Security
[!NOTE] Ox Content is an independent personal project by ubugeeei. It is not an official VoidZero project, product, or endorsement. The current branding is an intentional homage to the VoidZero ecosystem because I care a lot about that design direction and hope I can contribute more directly in the future. If VoidZero or the relevant rights holders would prefer that I stop using this branding direction, I will change it.
.mdx alongside Markdown in Vite, SSG, and framework integrationscargo doc)npm install @ox-content/napi
import { parseAndRender } from "@ox-content/napi";
const { html } = parseAndRender("# Hello World", { gfm: true });
npm install @ox-content/vite-plugin
@ox-content/vite-plugin already installs the native @ox-content/napi dependency it needs.
// vite.config.ts
import { defineConfig } from "vite";
import { oxContent } from "@ox-content/vite-plugin";
export default defineConfig({
plugins: [
oxContent({
srcDir: "docs",
outDir: "dist/docs",
highlight: true,
ssg: {
siteName: "My Docs",
},
}),
],
});
ox-content-migrate-vitepress .vitepress/config.ts \
--src-dir docs \
--out-dir dist \
--out ox-content.config.ts
The same migration runner is available across JavaScript runtimes:
# Node.js, after installing @ox-content/vite-plugin
ox-content-migrate-vitepress .vitepress/config.ts --out ox-content.config.ts
# Deno
deno run -A npm:@ox-content/vite-plugin/vitepress-migrate .vitepress/config.ts \
--out ox-content.config.ts
# Bun
bunx --bun @ox-content/vite-plugin .vitepress/config.ts --out ox-content.config.ts
The generated ox-content.config.ts contains an editable OxContentOptions object built from
VitePress settings such as title, base, themeConfig.sidebar, themeConfig.socialLinks,
themeConfig.footer, and search placeholder.
layout: home frontmatter is also accepted for landing pages during SSG/dev rendering.
npm install @ox-content/wasm
import init, { parseAndRender, WasmParserOptions } from "@ox-content/wasm";
await init();
const options = new WasmParserOptions();
options.gfm = true;
options.tables = true;
options.taskLists = true;
const result = parseAndRender("# Hello from WASM", options);
console.log(result.html);
# Vue
npm install @ox-content/vite-plugin-vue
# React
npm install @ox-content/vite-plugin-react
# Svelte
npm install @ox-content/vite-plugin-svelte
# Check for missing/unused translation keys
ox-content-i18n check --dict-dir content/i18n --src src
# Validate an ICU MessageFormat 2 message
ox-content-i18n validate "Hello {$name}"
# Check every link in a tree, exit non-zero on broken targets
ox-content-link-check docs/**/*.md
# Treat `/foo.md` as workspace-rooted under docs/
ox-content-link-check --src-dir docs docs/**/*.md
# Suppress known intentionally-broken targets
ox-content-link-check --ignore "intentionally-broken" docs/**/*.md
Offline-only by design — http:// and https:// links pass through
without a network request, so the same binary is safe to run in CI
without timeouts, retries, or rate limits.
Ox Content now ships a unified authoring and i18n language server:
cargo run -p ox_content_lsp --bin ox-content-lsp
You can wire it into:
Supported features include:
.mdc authoring support with component tag diagnostics[…](,  |
670 | 1.49 ms | 31.89 MB/s |
md4x (napi) |
623 | 1.60 ms | 29.66 MB/s |
markdown-it |
596 | 1.68 ms | 28.37 MB/s |
marked |
386 | 2.59 ms | 18.38 MB/s |
@mizchi/markdown |
41 | 24.19 ms | 1.97 MB/s |
remark |
27 | 36.56 ms | 1.30 MB/s |
| Library | ops/sec | avg time | throughput |
|---|---|---|---|
@ox-content/napi |
3738 | 0.27 ms | 177.90 MB/s |
md4x (napi) |
2270 | 0.44 ms | 108.03 MB/s |
md4w (md4c) |
1737 | 0.58 ms | 82.67 MB/s |
satteri |
1043 | 0.96 ms | 49.63 MB/s |
markdown-it |
481 | 2.08 ms | 22.88 MB/s |
marked |
327 | 3.06 ms | 15.57 MB/s |
@mizchi/markdown |
237 | 4.21 ms | 11.29 MB/s |
micromark |
29 | 34.76 ms | 1.37 MB/s |
remark |
24 | 41.92 ms | 1.14 MB/s |
| Library | ops/sec | avg time | throughput |
|---|---|---|---|
@ox-content/napi |
144 | 6.92 ms | 147.83 MB/s |
satteri |
54 | 18.66 ms | 54.83 MB/s |
md4w (md4c) |
32 | 31.04 ms | 32.97 MB/s |
md4x (napi) |
27 | 36.37 ms | 28.13 MB/s |
markdown-it |
21 | 48.49 ms | 21.10 MB/s |
marked |
16 | 63.16 ms | 16.20 MB/s |
@mizchi/markdown |
1 | 836.85 ms | 1.22 MB/s |
remark |
1 | 1839.10 ms | 0.56 MB/s |
| Library | ops/sec | avg time | throughput |
|---|---|---|---|
@ox-content/napi |
164 | 6.08 ms | 168.24 MB/s |
md4x (napi) |
103 | 9.71 ms | 105.41 MB/s |
md4w (md4c) |
79 | 12.59 ms | 81.24 MB/s |
satteri |
37 | 26.70 ms | 38.32 MB/s |
markdown-it |
15 | 67.75 ms | 15.10 MB/s |
marked |
14 | 73.27 ms | 13.96 MB/s |
@mizchi/markdown |
10 | 99.77 ms | 10.25 MB/s |
micromark |
1 | 817.55 ms | 1.25 MB/s |
remark |
1 | 1981.80 ms | 0.52 MB/s |
Ox Content leads every comparison: 1.95× ahead of the next-fastest parser (satteri) on parse-only and 1.65× ahead of md4x (napi) on parse+render at 48.7 KB, and it holds that lead at ~1 MB (2.7× / 1.6×) while sustaining ~148–168 MB/s. The incremental CST parser (@mizchi/markdown) and the unified/remark and micromark pipelines fall to ~1 op/sec at 1 MB. See node benchmarks/bundle-size/parse-benchmark.mjs for the full sweep across small, medium, large, and ~1 MB inputs.
Run the benchmark with:
node benchmarks/bundle-size/parse-benchmark.mjs
The script compares against satteri, @mizchi/markdown, md4w (md4c), and md4x (napi) by default, and includes Bun.markdown.html automatically when bun is installed.
nix develop # Enter the pinned dev shell
vp install # Install JS dependencies through Vite+
vp fmt # Format Rust and JS/TS sources
vp check # Check Rust and JS/TS sources
vp dev # Start the docs and playground dev servers
vp build # Build Rust, npm packages, docs, and playground
The dev shell is pinned in flake.nix, the workspace task graph lives in vite.config.ts, and .node-version is kept for CI / non-Nix Node setup.
See CONTRIBUTING.md for branch, commit, PR, testing, and release-note guidance.
See the documentation for more details.
Special thanks to kazupon for substantial community contributions around JSDoc support, including the API docs generation pipeline and documentation quality.
If you find Ox Content useful, please consider sponsoring the project.
MIT License - see LICENSE