Have rustdoc create hyperlinks on items in compiled code examples
Currently we just generate HTML for the code examples by compiling markdown.
However, rustdoc could compile these examples with a plugin that emits resolved path information for each ExprPath and import being used. This part isn't too hard. Might actually be useful as a plugin to be run on independent rust programs.
Then, we need to tweak the syntax highlighting bits so that these paths (those with a known span, that is), get linked appropriately.
cc @alexcrichton @steveklabnik
I believe we have a bug open for this already? It's been this way for so long, we have to have had...
Steve Klabnik at 2015-10-10 21:15:47
This is basically just DXR in rustdoc
Alex Crichton at 2015-10-11 17:11:22
Yeah, we realized that after discussing a bit.
Manish Goregaokar at 2015-10-11 18:38:30
So is this issue still open then? Or is it a duplicate?
Matt Gambogi at 2016-01-07 19:10:42
I don't think so, but DXR exists which gives a similar code search (just not in rustdoc examples). Not sure if this is worth pursuing.
Manish Goregaokar at 2016-01-08 14:50:50
Triage: no change
Steve Klabnik at 2019-12-25 16:22:15