Implementation crate for the code! macro re-exported by dioxus-code under its default macro feature. You usually depend on dioxus-code instead of pulling this in directly.
The macro reads a source file at compile time, parses it with arborium, and expands to a static span tree. The runtime binary ships only the spans — no parser.
use code;
let tree = code!;
Path resolution
Paths are resolved relative to the consumer's CARGO_MANIFEST_DIR. A leading / anchors to that directory; bare paths resolve from it as well. concat!(...) and env!(...) expressions are also accepted.
code!;
Explicit language
When the file extension isn't enough to infer the language, pass language = "...":
code!;
License
MIT.