-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo doc should render crate examples and link to them on main documentation page #2760
Comments
I have a shell script that I'm using in my For the interested: In my crate, this is a typical input example ( |
So thought I'd bump this issue and see if there anyone looking at adding this IMHO very helpful feature. |
rust-lang/rust#88791 scrapes the examples and links to them from the API items used in the examples but it doesn't seem to provide a central list of all examples. @willcrichton did that idea ever come up? |
We haven't talked about exactly that concept, but it's a great idea! FWIW, as a part of my scrape examples feature, rustdoc will now generate source files for scraped examples. So that infrastructure could be reused for this proposed feature. One challenge to consider: a number of crates have examples, but these examples don't fall under the The broader point: it might make sense for this feature to go hand-in-hand with a broader push to improve the |
(re-filing of rust-lang/rust#34022)
Cargo allows crate developers to create examples to show off their crate's API (as shown in http://doc.crates.io/guide.html#project-layout). These examples are very useful to see how the individual items in a crate can be used together, in a way that the standard documentation doesn't capture very well.
When viewing a crate's documentation, it would be useful if examples were rendered as standard source files, and there were links to view them on the main library overview page.
The text was updated successfully, but these errors were encountered: