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

Add links to examples folder #132

Open
tafia opened this issue Jun 14, 2017 · 5 comments
Open

Add links to examples folder #132

tafia opened this issue Jun 14, 2017 · 5 comments
Labels
E-easy Effort: Should be easy to implement and would make a good first PR P-medium Medium priority

Comments

@tafia
Copy link

tafia commented Jun 14, 2017

Not sure if it is possible, but as examples are complimentary to documentation, it would be nice if docs.rs could provide links to examples in the repo examples directory (even perhaps render them?).

@crumblingstatue
Copy link

This would be beneficial, as new users might not know that examples are located under the examples folder in the source code.

This should be relatively easy. Just detect if there is src/examples, and if it's present, add a dedicated Examples link to the top bar.

@Kixiron
Copy link
Member

Kixiron commented May 27, 2020

Triage: This can be part of #740 as we pass the have_examples variable to templates, however I can see issues related to crates that don't use an examples folder for examples which might require expanding the parsing we do on each crate's Cargo.toml

@Nemo157
Copy link
Member

Nemo157 commented May 27, 2020

Could also be related to #238, in that if we start generating documentation for examples then they'll have [src] links in them.

@stefnotch
Copy link

This should be quite doable already. docs.rs includes the examples in the source tab, for example https://docs.rs/crate/chumsky/latest/source/examples/brainfuck.rs

And docs.rs is aware of how to get to the source tab.
image

So now it should just be a matter of putting the right link in the side-bar, I suppose?

@Nemo157
Copy link
Member

Nemo157 commented Aug 19, 2023

Everything except the topbar of the documentation pages is generated by rustdoc, we don't really want to be trying to inject extra stuff into the side-bar after the page was generated.

@syphar syphar added E-easy Effort: Should be easy to implement and would make a good first PR P-medium Medium priority labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Effort: Should be easy to implement and would make a good first PR P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

6 participants