Diagram/Graph in doc

how to make a diagram / graph in documentation?

For example:

    ///My description 
    /// graph TD;
    pub fn my_function(){}

You can make a graph in graphviz, then convert it to svg using dot -Tsvg and put the svg directly in your documentation or use something like:

// Macro copied from core/num/mod.rs
macro_rules! doc_comment {
    ($x:expr, $($tt:tt)*) => {
        #[doc = $x]

doc_comment! {
    concat!("Part before the graph", include_str!("./graph.svg"), "Part after the graph"),
    fn a() {}

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.