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

Clarification of terms #70898

Closed
pavelrappo opened this issue Apr 7, 2020 · 4 comments · Fixed by #87865
Closed

Clarification of terms #70898

pavelrappo opened this issue Apr 7, 2020 · 4 comments · Fixed by #87865
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@pavelrappo
Copy link

The rustdoc documentation mentions a number of terms which I haven't found the definitions for. Might it be that they are either undefined or defined elsewhere?

@Alexendoo Alexendoo added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 9, 2020
@pavelrappo
Copy link
Author

Could compiltest be a simple typo? (There's the compiletest utility; note "e" in its name.)

@jyn514 jyn514 added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Aug 25, 2020
@GuillaumeGomez
Copy link
Member

compiltest is definitely a typo. Sending a quick fix.

JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 29, 2020
@jyn514 jyn514 added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Nov 4, 2020
@justjosias
Copy link
Contributor

It looks like blocks are being "annotated" with "directives" and "attributes", where:

  • annotation is adding the directive or attribute,
  • directives tell what should be done with the block (such as, ignore), and
  • attributes give the compiler information about the block (such as, text, which means it simply represents text the compiler can ignore).

So I don't think much needs to be changed, unless this needs to be made more explicit somehow.

@njasm
Copy link
Contributor

njasm commented Nov 30, 2020

I can understand and relate with the Attribute title of that documentation section being confusing.

Rust already defines Attributes. For instance cfg and others in the context of the language itself. Inner or Outer ones.
ex. #[test] or #![foo = "bar"]
cf. https://doc.rust-lang.org/reference/attributes.html

Getting back to the documentation, the text details directives that exist and can be used in the context of rustdoc and code that might be testable.

So, I suggest to:

  1. Change that section's (https://doc.rust-lang.org/rustdoc/documentation-tests.html#attributes) title to Directives
  2. do a pass on the rest of that chapter's text and remove/refactor text into directive/s where we might be using attribute/s or annotation/s.

PS - O wrote more to explaining the rational of my suggestion, than I'll have to write to eventually fix this issue, if you all agree ofc. 😅

JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 10, 2021
Clarify terms in rustdoc book

Fixes rust-lang#70898

I chose to completely remove the term directive over attribute because rustdoc has a lint called `invalid_codeblock_attributes` and the term attributes is used throughout the book. I slightly changed the introductory sentence to describe the relationship between annotations and attributes.

I also moved the text explaining the example from below the blocks to above the blocks which is more in line with the rest of the book. I also changed the description for the `should_panic` attribute as I found it a little confusing. Finally, some of the blocks were `text` and some were `rust` so I changed them all to `text` which is in line with the rest of the book.
JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 10, 2021
Clarify terms in rustdoc book

Fixes rust-lang#70898

I chose to completely remove the term directive over attribute because rustdoc has a lint called `invalid_codeblock_attributes` and the term attributes is used throughout the book. I slightly changed the introductory sentence to describe the relationship between annotations and attributes.

I also moved the text explaining the example from below the blocks to above the blocks which is more in line with the rest of the book. I also changed the description for the `should_panic` attribute as I found it a little confusing. Finally, some of the blocks were `text` and some were `rust` so I changed them all to `text` which is in line with the rest of the book.
@bors bors closed this as completed in b9b8f5b Aug 11, 2021
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 C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants