-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 option to include private definition in the documentation. #15347
Comments
I'm -1. You can use regular comments for internal documentation. |
Closing, you can actually do this today!
By default rustdoc has a pass to strip private items, but those flags are just disabling that pass from running. |
This at least not work in my crate. All private definitions are still hidden. Beside that, I get a strange error message "ERROR:rustdoc: unknown pass collapse-docs unindent-comments, skipping" when I use both passes. |
Hm it appears that they seem to no longer work! reopening. |
I’d like this (and a way to have
Navigation in a text editor is not nearly as easy as in rustdoc, where clicking on most things gets you to the documentation of that thing. This is invaluable when working on a large code base that you don’t know very well. |
+1. Writing a library, would benefit from being able to see private documentation while I work. |
It does look like the workaround
works. (Need multiple invocations for "passes"). Recommend close. |
@drewcrawford are these |
They're |
Include private items in `./mach doc` and http://doc.servo.org/ See rust-lang/rust#15347 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6655) <!-- Reviewable:end -->
We turned this on on http://doc.servo.org/ . It’s better, but not ideal: all |
@alexcrichton, could you edit #15347 (comment) ?
It should be |
`rustdoc --passes "collapse-docs unindent-comments"` doesn’t work is intended. It still generate HTML files that look alright at a glance, but all doc-comments are truncated to their first line for some reason I don’t understand. See http://doc.servo.org/script/dom/index.html for example. The module documentation there is currently just “The implementation of the DOM.”, but clicking the [src] link shows a much larger doc-comment. rust-lang/rust#15347 (comment) The correct invokation is to use `--passes` multiple times.
Make doc comments not truncated again. `rustdoc --passes "collapse-docs unindent-comments"` doesn’t work is intended. It still generate HTML files that look alright at a glance, but all doc-comments are truncated to their first line for some reason I don’t understand. See http://doc.servo.org/script/dom/index.html for example. The module documentation there is currently just “The implementation of the DOM.”, but clicking the [src] link shows a much larger doc-comment. The correct invocation is to use `--passes` multiple times. rust-lang/rust#15347 (comment) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6668) <!-- Reviewable:end -->
Would it be possible to always generate a "Developer documentation" section for crates that contains the docs of private items alongside the documentation for the public API ? Both should obviously be separated, but I think it is valuable to have both, and for users to always be able to read both. |
I agree with gnzlbg. Sometimes it is good to be able to search. |
It's something that does not change how official documentation is handled, but that could help a bunch of us. |
I don't see why it shouldn't be provided for the official documentation as well, the split between public API and developer documentation would jut need to be made very clear. Say somebody properly documented some internal standard library function, and I want to read its documentation because I think doing so is FUN. Do I really need to read it online in the source file? Or do I need to get a copy and generate it my self? Seems like unnecessary hassle and probably is contraproductive. Having easier ways to get people to know the internals of libraries, including the standard library is_good_. It helps people become contributors, it gets more eyes on the libraries internals and their implementation, it finds bugs if someone goes "wait a second, that doesn't make sense", or improves performance if somebody else goes "why are they using this algorithm, this other one is way better!". |
…/doc.servo.org/ (from servo:rustdoc-private); r=Manishearth See rust-lang/rust#15347 Source-Repo: https://github.com/servo/servo Source-Revision: a24783df4be2641afab3aa72626f9c59f90d49af
…o:untruncated-docs); r=Ms2ger `rustdoc --passes "collapse-docs unindent-comments"` doesn’t work is intended. It still generate HTML files that look alright at a glance, but all doc-comments are truncated to their first line for some reason I don’t understand. See http://doc.servo.org/script/dom/index.html for example. The module documentation there is currently just “The implementation of the DOM.”, but clicking the [src] link shows a much larger doc-comment. The correct invocation is to use `--passes` multiple times. rust-lang/rust#15347 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 685a44e1f5017849c341850696a77418bcc14011
…/doc.servo.org/ (from servo:rustdoc-private); r=Manishearth See rust-lang/rust#15347 Source-Repo: https://github.com/servo/servo Source-Revision: a24783df4be2641afab3aa72626f9c59f90d49af UltraBlame original commit: 17cd2249a7c28276e340ea269ab132cd671b3105
…o:untruncated-docs); r=Ms2ger `rustdoc --passes "collapse-docs unindent-comments"` doesn’t work is intended. It still generate HTML files that look alright at a glance, but all doc-comments are truncated to their first line for some reason I don’t understand. See http://doc.servo.org/script/dom/index.html for example. The module documentation there is currently just “The implementation of the DOM.”, but clicking the [src] link shows a much larger doc-comment. The correct invocation is to use `--passes` multiple times. rust-lang/rust#15347 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 685a44e1f5017849c341850696a77418bcc14011 UltraBlame original commit: 0efcf0a5749de8797b5692794a7dfefbe64bb1d6
…/doc.servo.org/ (from servo:rustdoc-private); r=Manishearth See rust-lang/rust#15347 Source-Repo: https://github.com/servo/servo Source-Revision: a24783df4be2641afab3aa72626f9c59f90d49af UltraBlame original commit: 17cd2249a7c28276e340ea269ab132cd671b3105
…o:untruncated-docs); r=Ms2ger `rustdoc --passes "collapse-docs unindent-comments"` doesn’t work is intended. It still generate HTML files that look alright at a glance, but all doc-comments are truncated to their first line for some reason I don’t understand. See http://doc.servo.org/script/dom/index.html for example. The module documentation there is currently just “The implementation of the DOM.”, but clicking the [src] link shows a much larger doc-comment. The correct invocation is to use `--passes` multiple times. rust-lang/rust#15347 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 685a44e1f5017849c341850696a77418bcc14011 UltraBlame original commit: 0efcf0a5749de8797b5692794a7dfefbe64bb1d6
…/doc.servo.org/ (from servo:rustdoc-private); r=Manishearth See rust-lang/rust#15347 Source-Repo: https://github.com/servo/servo Source-Revision: a24783df4be2641afab3aa72626f9c59f90d49af UltraBlame original commit: 17cd2249a7c28276e340ea269ab132cd671b3105
…o:untruncated-docs); r=Ms2ger `rustdoc --passes "collapse-docs unindent-comments"` doesn’t work is intended. It still generate HTML files that look alright at a glance, but all doc-comments are truncated to their first line for some reason I don’t understand. See http://doc.servo.org/script/dom/index.html for example. The module documentation there is currently just “The implementation of the DOM.”, but clicking the [src] link shows a much larger doc-comment. The correct invocation is to use `--passes` multiple times. rust-lang/rust#15347 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: 685a44e1f5017849c341850696a77418bcc14011 UltraBlame original commit: 0efcf0a5749de8797b5692794a7dfefbe64bb1d6
Since this had more search priority than a lot of the other issues around this topic, putting a note here that in rust-lang/cargo#5543 an option |
+1 As both a user and maintainer of library it would be valauable to have a full "developer" section. I'd argue that many users would benefit from also understanding internals directly from docs, even if they are not going to directly use them. |
Please do not leave comments on this issue - you can document private definitions with |
Please add an option for rustdoc such that rustdoc creates a proper documentation for private definitions.
While it is in general a good idea to hide these private definitions, as a crate developer it would be very valuable to have a good internal documentation of private types and functions.
The text was updated successfully, but these errors were encountered: