dioxus-docs-kit-build
Build-time helper for dioxus-docs-kit. Reads your _nav.json navigation file and generates a content map that embeds all MDX files via include_str!() at compile time.
Usage
Add it as a build dependency:
[]
= "0.2"
Create a build.rs:
Then use the doc_content_map!() macro from dioxus-docs-kit to consume the generated file:
doc_content_map!;
// Now `doc_content_map()` returns HashMap<&'static str, &'static str>
What it does
- Reads the
_nav.jsonfile to discover all doc pages - Emits
cargo:rerun-if-changedfor_nav.jsonand every.mdxfile - Writes
doc_content_generated.rstoOUT_DIRcontaininginclude_str!()calls for each page
The docs directory is inferred from the parent of the nav path (e.g. "docs/_nav.json" uses "docs/").
License
MIT