Skip to content

pi0/ox-content

 
 

Repository files navigation

Ox Content logo

cargo doc for JavaScript
Rust-powered document generator and high-performance Markdown toolkit

DocumentationGetting StartedPlayground

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.


Features

  • Blazing Fast - Arena-allocated parser with zero-copy parsing
  • mdast Compatible - Full compatibility with the unified ecosystem
  • GFM Support - Tables, task lists, strikethrough, autolinks, footnotes
  • Multi-Runtime - Node.js (NAPI), WebAssembly, Native Rust
  • Framework Agnostic - Works with Vue, React, Svelte, and more
  • Built-in SSG - Static site generation with theming, search, and OG images
  • API Docs Generation - Generate docs from JSDoc/TypeScript (like cargo doc)
  • i18n - ICU MessageFormat 2 parser, dictionary management, static checker, and LSP
  • Editor Tooling - Markdown/MDC LSP plus VS Code, Zed, and Neovim integrations

Quick Start

Basic Usage (Node.js)

npm install @ox-content/napi
import { parseAndRender } from "@ox-content/napi";

const { html } = parseAndRender("# Hello World", { gfm: true });

Vite Plugin

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",
      },
    }),
  ],
});

Browser Usage (WebAssembly)

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);

Framework Integration

# Vue
npm install @ox-content/vite-plugin-vue

# React
npm install @ox-content/vite-plugin-react

# Svelte
npm install @ox-content/vite-plugin-svelte

i18n Static Checker (CLI)

# 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}"

Editor Tooling

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:

  • fast Markdown snippet completion
  • frontmatter schema completion and diagnostics
  • i18n key completion, hover, go-to-definition, diagnostics, and inlay hints for JS/TS
  • table / code fence / callout insertion commands
  • preview HTML generation for editor UIs
  • .mdc authoring support

Read the full documentation →

Performance

Ox Content is positioned both as a document generator and as a high-performance Markdown toolkit. The numbers below focus on the Markdown engine side.

Latest local benchmark sweep on 2026-04-22 with Node v24.15.0 on Apple M5 Pro. The tables below show median results from 7 local runs of the benchmark harness for the large 48.7 KB case.

Parse Only (48.7 KB)

Library ops/sec avg time throughput
@ox-content/napi 2933 0.34 ms 139.55 MB/s
md4w (md4c) 1054 0.95 ms 50.16 MB/s
markdown-it 807 1.24 ms 38.42 MB/s
marked 512 1.95 ms 24.36 MB/s
remark 42 23.89 ms 1.99 MB/s

Parse + Render (48.7 KB)

Library ops/sec avg time throughput
@ox-content/napi 3273 0.31 ms 155.73 MB/s
Bun.markdown.html 2848 0.35 ms 135.52 MB/s
md4w (md4c) 2608 0.38 ms 124.13 MB/s
markdown-it 787 1.27 ms 37.44 MB/s
marked 489 2.04 ms 23.28 MB/s
micromark 44 22.62 ms 2.10 MB/s
remark 36 28.16 ms 1.69 MB/s

In this latest local release-build sweep, Ox Content came out on top for both parse-only and parse+render in the large 48.7 KB case while still serving as the native core for the full documentation pipeline.

Run the benchmark with:

node benchmarks/bundle-size/parse-benchmark.mjs

The script now compares against md4w (md4c) by default and will include Bun.markdown.html automatically when bun is installed.

Development

nix develop           # Enter the pinned dev shell
vp install             # Install JS dependencies through Vite+
vp run build:napi      # Build NAPI bindings
vp run build:npm       # Build npm packages
vp run build:wasm      # Build publish-ready @ox-content/wasm package
cargo check -p ox_content_lsp
vp run test            # Run tests

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 the documentation for more details.

Sponsor

If you find Ox Content useful, please consider sponsoring the project.

License

MIT License - see LICENSE

About

The framework agnostic fastest and beautiful documentation tooling for JS/TS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 48.2%
  • TypeScript 40.6%
  • CSS 5.3%
  • JavaScript 3.8%
  • HTML 1.2%
  • Lua 0.5%
  • Other 0.4%