mersinvald / aquamarine

Inline diagrams for rustdoc with mermaid.js
MIT License
487 stars 25 forks source link

Not rendering anything besides very simple diagrams #25

Closed elcapitano-lol closed 1 year ago

elcapitano-lol commented 1 year ago

Hello,

First of all thanks for the crate, I think it's great! We're trying to use it to enhance our documentation but we're coming across a silly issue. We can't render anything other than very very basic diagrams.

This works:

#[cfg_attr(doc, aquamarine::aquamarine)]
/// Enum 'Mode' can take values Privileged (supervisor) or Unprivileged (user).
/// ```mermaid
/// classDiagram
/// class Mode
/// ```
pub enum Mode {
    Privileged,
    Unprivileged,
}

image

This doesn't work:

#[cfg_attr(doc, aquamarine::aquamarine)]
/// Enum 'Mode' can take values Privileged (supervisor) or Unprivileged (user).
/// ```mermaid
/// classDiagram
/// class Mode {
///     <<enumeration>>
///     Privileged
///     Unprivileged
/// }
/// ```
pub enum Mode {
    Privileged,
    Unprivileged,
}

image

When testing on mermaid.live, there seems to be no issue with both diagrams. I'm sure I'm doing something wrong but I can't seem to find what :) Thanks for the help!