Crates.io | simple-mermaid |
lib.rs | simple-mermaid |
version | 0.1.1 |
source | src |
created_at | 2023-09-24 03:35:07.815972 |
updated_at | 2024-01-09 17:20:48.716223 |
description | Simple Mermaid diagrams RustDoc integration |
homepage | https://github.com/glueball/simple-mermaid |
repository | https://github.com/glueball/simple-mermaid |
max_upload_size | |
id | 981701 |
size | 13,980 |
Simple Mermaid diagrams RustDoc integration
This crate provides a simple declarative macro to include mermaid diagrams in your rustdoc documentation. Lookup the great mermaid documentation for details on the diagram syntax.
.mmd
or .mermaid
extension).#[doc]
attribute. Specify the route to the diagram file as a
string literal. Note that the path is interpreted relative to the file where the macro is called,
as it happens with the underlying include_str.The aquamarine introduces a procedural macro that converts regular code blocks marked with the mermaid language tag. It also allows including the diagram from external files, but that comes with some limitations:
Those limitations made aquamarine a non-option for me, since I strongly prefer leaving the diagrams in external files for several reasons: clutter, maintainability, IDE support, and, re-usability of the diagrams.
Besides, the declarative macro used in this crate should be easier on compile times. And it comes with no dependencies at all!
The rsdoc crate provides procedural macros to embed PlantUML and images in doc coments. It can be used with code-blocks (similar to aquamarine) or with external files (similar to this crate). So, in this case, for me it was just a matter of personal taste, both PlantUML and mermaid are fantastic opensource projects. But PlantUML is Java... and my plants always die (even a cactus I once had! How can a cactus die? The thing should not need water!).
Neither this crate nor it's autor have any relation or affiliation with the mermaid project, other that being an user of this magnific library.
All the examples in this documentation have been extracted, verbatim or with minor updates, from the mermaid documentation.
License: MIT