Install

Install the @rho/md library + required / optional dependencies.


Required

npm install @rho/md

Status — not on npm yet: neither stl-md nor @rho/md resolves on the npm registry today, so the npm install and CDN lines in this section describe the planned package and will fail if you run them now. This section is kept as the forward-looking reference for when the package ships.

Peer dependencies (markdown pipeline)

@rho/md uses the unified ecosystem as its markdown parser. These are peer dependencies — install yourself:

npm install unified remark-parse remark-gfm remark-rehype rehype-stringify
Package Role
unified Pipeline orchestration
remark-parse Markdown → AST
remark-gfm GitHub-flavored markdown extensions (callout / table / etc.)
remark-rehype Markdown AST → HTML AST
rehype-stringify HTML AST → HTML string

Optional dependencies

Vega-Lite chart support

To use Interact + Vega-Lite chart:

npm install vega-embed

vega-embed is an optional peer dependency. Skipping it doesn't affect other capabilities — only vega-lite templates won't render.

STL syntax highlighting

To use STL syntax highlighting:

npm install highlight.js
# or
npm install lowlight

highlight.js for client-side highlighting; lowlight for server-side / build-time highlighting.


Manifest summary

Minimal package.json (Rho + required deps only):

{
  "dependencies": {
    "@rho/md": "^0.1.0",
    "unified": "^11.0.5",
    "remark-parse": "^11.0.0",
    "remark-gfm": "^4.0.1",
    "remark-rehype": "^11.0.0",
    "rehype-stringify": "^10.0.0"
  }
}

Full support (with chart + STL highlighting):

{
  "dependencies": {
    "@rho/md": "^0.1.0",
    "unified": "^11.0.5",
    "remark-parse": "^11.0.0",
    "remark-gfm": "^4.0.1",
    "remark-rehype": "^11.0.0",
    "rehype-stringify": "^10.0.0",
    "vega-embed": "^7.0.0",
    "highlight.js": "^11.11.0"
  }
}

TypeScript support

@rho/md ships its own .d.ts declarations — no @types/... needed; TypeScript projects import directly.

import { hydrateAll, remarkPlugins } from '@rho/md';
import type { ProcessorOptions } from '@rho/md';      // Types importable too

CSS / styles

import '@rho/md/css';

Or link directly from HTML (CDN / static hosting):

<link rel="stylesheet" href="path/to/@rho/md/css/stl-md.css">

See CSS theming.


Browser targets

@rho/md build target is ES2020 — supports:

  • Chrome 80+
  • Firefox 75+
  • Safari 13.1+
  • Edge 80+

Node.js: 18+.

Older browsers / Node 16- need Babel / Vite plugin transpilation.


CDN (not supported yet)

A UMD bundle is planned for @rho/md v0.2 — then you'll be able to:

<!-- After v0.2 -->
<script src="https://cdn.jsdelivr.net/npm/@rho/[email protected]/dist/index.umd.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@rho/[email protected]/css/stl-md.css">

Current v0.1 only supports ESM imports.


Verify install

After installing, run a minimal sanity check:

import { remarkPlugins, hydrateAll } from '@rho/md';

console.log(remarkPlugins.length);     // Should print 7
console.log(typeof hydrateAll);        // Should print "function"

If both succeed → import is working.


Next

→ Quick start (unified pipeline) — first working demo after install