mdbook_uplot 0.1.0

mdbook preprocessor for interactive uPlot charts
Documentation

mdbook-uplot

An mdbook preprocessor for embedding interactive uPlot charts in your book.

Installation

Using cargo-binstall

If you have cargo-binstall already:

cargo binstall mdbook-uplot

Manually

Binary releases are available on the Releases page. Download the appropriate binary for your platform, make it executable, and add it to your PATH.

Setup

mdbook-uplot install /path/to/book

The install command updates book.toml (preprocessor config, additional-js/css) and writes asset files and CDN links to theme/head.hbs.

Usage

In your markdown, use a fenced code block with the uplot language tag.

Inline data

```uplot
{
  "labels": ["a", "b", "c"],
  "datasets": [
    { "label": "Series 1", "data": [10, 20, 30], "color": "#e74c3c" }
  ],
  "axes": { "x": "Category", "y": "Value" }
}
```

External data file

```uplot
{ "data": "path/to/data.json" }
```

Paths are resolved relative to the chapter's source directory.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

Licensed under either of

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.