| Crates.io | arborium-docsrs-demo |
| lib.rs | arborium-docsrs-demo |
| version | 2.12.4 |
| created_at | 2025-12-09 09:35:35.697853+00 |
| updated_at | 2026-01-18 11:08:32.978513+00 |
| description | Demo crate showcasing arborium syntax highlighting on docs.rs |
| homepage | |
| repository | https://github.com/bearcove/arborium |
| max_upload_size | |
| id | 1975159 |
| size | 9,524 |
This crate demonstrates arborium syntax highlighting on docs.rs.
docs.rs highlights Rust code natively, but leaves other languages (TOML, shell,
JSON, YAML, SQL, etc.) unhighlighted. This crate uses arborium's IIFE script
via --html-in-header to highlight everything else.
Create arborium-header.html:
<script defer src="https://cdn.jsdelivr.net/npm/@arborium/arborium@2.12.4/dist/arborium.iife.js"></script>
Add to Cargo.toml:
[package.metadata.docs.rs]
rustdoc-args = ["--html-in-header", "arborium-header.html"]
That's it! The IIFE automatically:
class="language-*"<a> links from rustdoc)Visit the module documentation to see highlighted TOML, shell, JSON, YAML, SQL, and more.