Skip to content

Documentation hides imports too aggressively #7689

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

Closed
huonw opened this issue Jul 10, 2013 · 5 comments
Closed

Documentation hides imports too aggressively #7689

huonw opened this issue Jul 10, 2013 · 5 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@huonw
Copy link
Member

huonw commented Jul 10, 2013

There are a lot of imports in code segments in the tutorial that are hidden in the final output (prefixed with #), which makes the code meet a pile of name-resolution errors.

In fact, use std:: is only mentioned 4 times in the whole thing. (The angle code of the pattern matching section is a good example of this.)

@zslayton
Copy link
Contributor

@huonw I wouldn't mind tackling this if no one else is working on it. Is it as simple as removing the prefixed '#' in the .md files?

Following the README file in the doc directory, I'm using:

pandoc --from=markdown --to=html --number-sections -o tutorial.html tutorial.md

to generate tutorial.html. However, the page it produces doesn't include the stylesheets necessary to make it look like the tutorial on rust-lang.org. (http://static.rust-lang.org/doc/tutorial.htm)

Do you happen to know how to reproduce the official format?

@huonw
Copy link
Member Author

huonw commented Jul 21, 2013

@zslayton yes it is just removing the #, and make docs will create the official format. This will do a full compile once to get the latest rustdoc, and then should just regenerate the docs themselves on later runs.

@zslayton
Copy link
Contributor

@huonw Cool, thanks -- I didn't have NodeJS installed so 'make docs' wasn't doing it initially.

I notice that in addition to the 'use' statements, there are also traits and functions that are commented out but referenced. Should I uncomment those as well? They're required in order to compile the examples, but add a fair amount of reading overhead.

@huonw
Copy link
Member Author

huonw commented Jul 22, 2013

@zslayton yes, but some of them are defined earlier and are just there to make that snippet pass the tests, or are functions in the standard library, so use your discretion about which to uncomment. (Maybe keep that as a separate commit, so it can be more easily modified/dropped if it is deemed too much extra code for the tutorial.)

@zslayton
Copy link
Contributor

@huonw Good call, will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants