# Charon

Charon renders Markdown as an HTML string in Node, a worker or the browser. It
needs no DOM. It also builds docs sites from a folder of Markdown: this site is
one.

## Render a string

```ts
import { renderToHtml } from '@memomori/charon'

const html = await renderToHtml('# Hello\n\nSome **bold** text.')
```

Import `@memomori/charon/styles.css` and wrap the HTML in `<article class="charon">`
to style it. See [Render in your app](render.md).

## Build a docs site

```sh
charon build docs -o site
```

Every `.md` file under `docs/` becomes a page with a sidebar, search, anchor
links and a Markdown copy. See [Build a docs site](sites/index.md).

## What it reads

CommonMark and GFM, plus:

- footnotes, definition lists, abbreviations, `^sup^`, `~sub~`, `==mark==`, `++ins++`, `:emoji:` and `{.attrs}`
- math with `$inline$` and `$$block$$`, drawn by KaTeX
- callouts such as `> [!NOTE]`
- `[[wikilinks]]`, `![[embeds]]`, `^block-ids` and `#tags`
- `%%comments%%`
- highlighted code, CSV and TSV tables, and Mermaid diagrams

[Markdown syntax](syntax.md) shows each one with its output.

## License

MIT.
