Closed frehberg closed 1 year ago
Fixing:
If invoking "cargo doc" the file target/doc/mermaid.min.js is created now.
If aquamarine macro is used in sub-module, the HTML rustdoc will be structured as sub-folder. Within the proc-maco we cannot tell length of module path. Therefor in HTML document the script-element must try to load from parent folders until succes, ../, then ../../ etc,
Load mermaid only once, even if multiple diagrams specified in single html
Other fix: glob-pattern / not supported by cargo:rerun-if-changed in build.rs As specified file './doc/' does not exist, the module would be rebuilt always!
Ping? Any comments? Is the patch not suitable? Would you like a change?
Fixed in #29
Thank you, @frehberg, sorry for the delay on my part
The generated html document contains primary and secondary source of mermaid.js (see below), but as the mermaid.js is not present in folder target/doc/{CRATENAME}, the secondary remote source is used always.
The doc files should not fetch JS code from remote. To solve the issue the aquamarine macro-processor should copy an embedded mermaid.js into the folder target/doc/{CRATENAME}