### Load Diagram from File Source: https://docs.rs/aquamarine/0.6.0/aquamarine/index.html Use the include_mmd! macro to reference external diagram files and keep doc comments clean. ```rust /// Diagram #1 /// include_mmd!("diagram_1.mmd") /// /// Diagram #2 /// include_mmd!("diagram_2.mmd") ``` -------------------------------- ### Custom Mermaid Theme Source: https://docs.rs/aquamarine/0.6.0/aquamarine/index.html Apply custom styling to a diagram using the %%init%% attribute within the mermaid code block. ```mermaid /// ```mermaid /// %%{init: { /// 'theme': 'base', /// 'themeVariables': { /// 'primaryColor': '#ffcccc', /// 'edgeLabelBackground':'#ccccff', /// 'tertiaryColor': '#fff0f0' }}}%% /// graph TD /// A(Diagram needs to be drawn) --> B{Does it have 'init' annotation?} /// B -->|No| C(Apply default theme) /// B -->|Yes| D(Apply customized theme) /// ``` ``` -------------------------------- ### Using the #[aquamarine] attribute macro Source: https://docs.rs/aquamarine/0.6.0/aquamarine/attr.aquamarine.html How to apply the aquamarine attribute to a struct or item to enable Mermaid diagram rendering in documentation. ```APIDOC ## #[aquamarine] ### Description Applies the aquamarine proc-macro to an item, enabling the rendering of Mermaid diagrams within the item's documentation. ### Usage Place the `#[aquamarine]` attribute above the item (e.g., struct, function) and include a `mermaid` code block within the doc comments. ### Example ```rust #[aquamarine] /// ```mermaid /// graph TD; /// A-->B; /// ``` struct Foo; ``` ``` -------------------------------- ### Inline a Mermaid diagram in rustdoc Source: https://docs.rs/aquamarine/0.6.0/aquamarine/attr.aquamarine.html Use the mermaid code block syntax within documentation comments to render diagrams. ```rust #[aquamarine] /// ```mermaid /// --- here goes your mermaid diagram --- /// ``` struct Foo; ``` -------------------------------- ### Inline Mermaid Diagram Source: https://docs.rs/aquamarine/0.6.0/aquamarine/index.html Use the #[aquamarine] attribute on a function and a mermaid code block in the doc-string to render a diagram. ```rust #[cfg_attr(doc, aquamarine)] /// ```mermaid /// graph LR /// s([Source]) --> a[[aquamarine]] /// r[[rustdoc]] --> f([Docs w/ Mermaid!]) /// subgraph rustc[Rust Compiler] /// a -. inject mermaid.js .-> r /// end /// ``` pub fn example() {} ``` -------------------------------- ### Apply the aquamarine attribute macro Source: https://docs.rs/aquamarine/0.6.0/aquamarine/attr.aquamarine.html Apply the attribute to a struct or item to enable Mermaid diagram support. ```rust #[aquamarine] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.