Skip to content
md-book

Getting started#

Install#

npm install @ibitsuki0296/md-book

Generate a manifest#

md-book needs a list of your Markdown files, because a browser cannot read a directory on its own:

npx md-book manifest ./content --base /

This writes content/manifest.json. Commit it, or regenerate it in CI.

Render a page#

import { renderMarkdown } from '@ibitsuki0296/md-book';

const { html, toc, frontMatter } = renderMarkdown(source, {
  linkRewrite: { currentPath: '/guide/getting-started' },
});

See Theming for how to restyle everything with CSS tokens.