This crate provides a procedural macro #[svgbobdoc::doc]
that renders
ASCII diagrams in doc comments as SVG images using [svgbob
].
Add the following line to Cargo.toml
.
toml
[dependencies]
svgbobdoc = "0.1"
Add the attribute #[svgbobdoc::doc]
to the items to documentate.
Use svgbob
code blocks to write ASCII diagrams.
#[svgbobdoc::doc]
/// Some structure.
///
/// ```svgbob
/// .--------------------.
/// | Diagrams here |
/// `--------------------'
/// ```
pub struct TestStruct {}
See the example
directory for a complete example.
doc_cfg
feature ([#43781]) can be
used to conditionally enable the macro by the syntax
#[cfg_attr(rustdoc, svgbobdoc::doc)]
.License: MIT/Apache-2.0