Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
mdbook-uplot
An mdbook preprocessor for embedding interactive uPlot charts in your book.
Write chart data as fenced ```uplot code blocks in your markdown and mdbook-uplot renders them as interactive charts.
Live documentation and examples

Installation
Shell (macOS/Linux)
|
PowerShell (Windows)
powershell -ExecutionPolicy ByPass -c "irm https://github.com/n1ght-hunter/mdbook_uplot/releases/latest/download/mdbook_uplot-installer.ps1 | iex"
cargo-binstall
From crates.io
Setup
Run the install command to configure your book:
This adds [preprocessor.uplot] to book.toml, registers the JS/CSS assets, and writes asset files. Assets are kept up to date automatically on every mdbook build.
Usage
Use a fenced code block with the uplot language tag:
```uplot
{
"type": "line",
"labels": ["Jan", "Feb", "Mar", "Apr", "May"],
"datasets": [
]
}
```
You can also reference an external JSON file instead of inlining data:
```uplot
{ "data": "path/to/data.json" }
```
Paths are resolved relative to the chapter's source directory.
Chart types
Set "type" to one of: "bar" (default), "line", "area", or "scatter".
Features
| Feature | Example |
|---|---|
| Axis labels | "axes": { "x": "Month", "y": "Revenue" } |
| Value formatting | "format": { "prefix": "$", "suffix": "k", "decimals": 1 } |
| Tooltip options | "tooltip": false or { "all": true } |
| Legend control | "legend": { "show": false } or { "live": true } |
| Code display | "code": false, or { "position": "side" }, "above", "below" |
| Editable playground | "editable": true — live JSON editor with syntax highlighting |
| Custom height | "height": 250 |
| uPlot pass-through | "opts": { "scales": { "y": { "range": [0, 100] } } } |
| Dark theme | Automatically adapts to coal, navy, and ayu themes |
See the documentation book for full details, live examples, and the customization reference.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
Licensed under either of
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) at your option.
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.