Open temportalflux opened 2 years ago
@temportalflux do you think it would be sufficient to set securityLevel: loose
as a default, under a hyperlinks
feature gate?
I don't want to make it a universal default, partly because it's a breaking change, and also because it is a security issue that I'm not qualified to assess, to be completely honest.
Yeah I think exposing that option would be fine, though I suspect it would only get integration halfway there. Since mermaid seems to want full url links, there would need to be some mechanism, enabled by a hyperlinks
flag, that converts rustdoc links in a mermaid block into true urls. Perhaps a preprocessor that asks rustdoc to return a hyper link given some rustdoc sybtax that aquamarine detects inside a mermaid-code-block.
I'll see if I can find some heuristic to do that, but it it's something that requires getting information from rustdoc
, then we're pretty much out of luck
It looks like resolving hyperlinks via rustdoc might be viable? I just happened upon this tutorial today which seems to do something similar via some unstable/nightly functionality in rustdoc. https://scrabsha.github.io/abcr-issue-0/#the-basic-idea https://doc.rust-lang.org/rustdoc/unstable-features.html#-w--output-format-output-format
Maybe this code snippet might be used to implement some kind of intelligent callback function to redirect to the API doc https://stackoverflow.com/a/73733645
Mermaid has support for interactions on flow-chart nodes and rustdocs can generate links to items by name. I'd be very helpful to be able to use both of these concepts and allow crate users to add links to nodes in mermaid syntax utilizing rustdocs item linkage syntax. Something like:
which would show something like
but where
Shown Text
is also a hyperlink to wherever the rustdocs hyperlink forrustdocs::symbol::path
leads.This WOULD require specifying
securityLevel:'loose'
in the mermaid config.