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

75521 rustdoc book improvements #75778

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

AndyGauge
Copy link
Contributor

@AndyGauge AndyGauge commented Aug 21, 2020

Added some guidelines about documenting with rustdoc
Fixes #75521

@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 21, 2020
@@ -1,14 +1,85 @@
# How to write documentation

Good documentation is not natural. There are opposing forces that make good
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering: do we have to keep two whitespaces between sentences? cc @rust-lang/docs


## Configuring rustdoc

There's two problems with this: first, why does it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There's two problems with this: first, why does it
There are two problems with this: first, why does it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I'll re-read it looking for more of these.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it looked more natural as a contraction, but either way is fine as long as it's consistent.

@GuillaumeGomez
Copy link
Member

This is a great start! I think if we should also talk more about the arguments that allows to customize the HTML output (for example, adding themes or adding your own JS/CSS files, etc...). We can do that in another PR though (but if so, don't mark this PR as a fix for #75521 ;) ).

@GuillaumeGomez
Copy link
Member

Oh also: I'll definitely need a native english person to double-check the typos and other things. :)

@AndyGauge
Copy link
Contributor Author

I agree with the themes included in this PR. Should I adjust the title to include work in process?

@GuillaumeGomez
Copy link
Member

Well, it remains "rustdoc improvements", so it's fine. But you might want to expand the description of the PR a bit if you do it in this PR. ;)

@ollie27 ollie27 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 22, 2020
Copy link

@Dylan-DPC-zz Dylan-DPC-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initial review tidbits, just felt it reads better, can ignore if you wish :D

src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have gone a little overboard.

src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/what-to-include.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/what-to-include.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/what-to-include.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/what-to-include.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/what-to-include.md Outdated Show resolved Hide resolved
@AndyGauge AndyGauge force-pushed the 75521-rustdoc-book-improvements branch from d7c21eb to 0f605b0 Compare August 22, 2020 15:25
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
Comment on lines 135 to 140
The first line of description will be reused to describe the component in
searches and module overviews. For example, the function `std::env::args()`
above will be shown on the [`std::env`] module documentation. Multi-line
summaries are also possible, however, concise writing is a goal of good
documentation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not correct - it implies that only the first line of a multi-line summary will be shown. It should say that everything before a line break will be shown, but it's good practice to only have one line in the summary.

src/doc/rustdoc/src/references.md Outdated Show resolved Hide resolved
@@ -7,22 +7,22 @@ CSS, and JavaScript.

## Basic usage

Let's give it a try! Let's create a new project with Cargo:
Let us give it a try! Create a new project with Cargo:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also seems really stilted.

@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2020
@bors
Copy link
Contributor

bors commented Sep 14, 2020

☔ The latest upstream changes (presumably #75740) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly looks good to me - there's a lot of new information, thank you so much! I'm still a little unsure about expanding out all the contractions (especially since some have been missed, and it's now a little inconsistent).

Also this adds a link to the rustdoc book when you pass --help, I'm not sure how I feel about that (#76427 (comment)). Maybe remove it for now and add it to #76427, so this PR won't be blocked on it?

src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
src/doc/rustdoc/src/what-is-rustdoc.md Outdated Show resolved Hide resolved
@jyn514 jyn514 added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Sep 14, 2020
@AndyGauge
Copy link
Contributor Author

Thanks for the feedback. Looks like there was an accidental merging of 2 tasks, thanks for identifying that. I'm a bit swamped now, but maybe this weekend I'll put some time into this.

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think any more changes can be done as follow-ups, this already looks really good. If you split out the change linking to the rustdoc book I think this ready to go.

@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 13, 2020
@GuillaumeGomez
Copy link
Member

It just requires to rebase to fix the merge conflict and then it's good to go!

@AndyGauge
Copy link
Contributor Author

I will get this done. We moved and that's been taking all my time lately.

@jyn514
Copy link
Member

jyn514 commented Oct 30, 2020

No worries! Thanks for writing this up, it's super helpful :) If you find you don't have time to finish it up I can rebase it myself, too.

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally we use a rebase-only workflow for PRs: https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy. Do you mind rebasing this instead to get rid of the merge conflict? There are instructions in https://rustc-dev-guide.rust-lang.org/git.html#rebasing, if you have trouble let me know and I'm happy to help.

src/doc/rustdoc/src/how-to-write-documentation.md Outdated Show resolved Hide resolved
@AndyGauge
Copy link
Contributor Author

AndyGauge commented Nov 4, 2020 via email

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
@AndyGauge AndyGauge force-pushed the 75521-rustdoc-book-improvements branch from f2c82d7 to 881820a Compare November 5, 2020 02:02
@AndyGauge
Copy link
Contributor Author

@jyn514 we good now?

@jyn514
Copy link
Member

jyn514 commented Nov 6, 2020

Looks great, thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 6, 2020

📌 Commit 881820a has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 6, 2020
@AndyGauge
Copy link
Contributor Author

wohoo!

@bors
Copy link
Contributor

bors commented Nov 6, 2020

⌛ Testing commit 881820a with merge a601302...

@bors
Copy link
Contributor

bors commented Nov 6, 2020

☀️ Test successful - checks-actions
Approved by: jyn514
Pushing a601302 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 6, 2020
@bors bors merged commit a601302 into rust-lang:master Nov 6, 2020
@rustbot rustbot added this to the 1.49.0 milestone Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more content into rustdoc book
9 participants