Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have rustdoc create hyperlinks on items in compiled code examples #28954

Open
Manishearth opened this issue Oct 10, 2015 · 6 comments
Open

Have rustdoc create hyperlinks on items in compiled code examples #28954

Manishearth opened this issue Oct 10, 2015 · 6 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Manishearth
Copy link
Member

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

@Manishearth Manishearth added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. labels Oct 10, 2015
@steveklabnik
Copy link
Member

I believe we have a bug open for this already? It's been this way for so long, we have to have had...

@alexcrichton
Copy link
Member

This is basically just DXR in rustdoc

@Manishearth
Copy link
Member Author

Yeah, we realized that after discussing a bit.

@gambogi
Copy link

gambogi commented Jan 7, 2016

So is this issue still open then? Or is it a duplicate?

@Manishearth
Copy link
Member Author

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.

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 24, 2017
@steveklabnik
Copy link
Member

Triage: no change

@jyn514 jyn514 changed the title Have rustdoc create links in compiled code examples Have rustdoc create hyperlinks on items in compiled code examples Nov 4, 2020
@ehuss ehuss removed the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants