about summary refs log tree commit diff
path: root/src/librustdoc/html/render
AgeCommit message (Collapse)AuthorLines
2021-09-02Stop using walk_crate.Camille GILLOT-1/+1
2021-09-01Auto merge of #88490 - GuillaumeGomez:associated-types-implementors-display, ↵bors-38/+81
r=camelid,Manishearth Display associated types of implementors Fixes #86631. Contrary to before, it doesn't display methods. I also had to "resurrect" the `auto-hide-trait-implementations` setting. :3 Only question at this point: should I move the `render_impl` boolean arguments into one struct? We're starting to have quite a lot of them... cc `@cynecx` r? `@camelid`
2021-09-01Remove implementors settingGuillaume Gomez-1/+0
2021-09-01Clean render_impl argumentsGuillaume Gomez-46/+67
2021-09-01Rollup merge of #88410 - camelid:fix-assoc-bold, r=GuillaumeGomezMara Bos-1/+1
Remove bolding on associated constants Associated types don't get bolded, so it looks off to have one kind bolded and one not.
2021-08-31Remove bolding on associated constantsNoah Lev-1/+1
Associated types don't get bolded, so it looks off to have one kind bolded and one not.
2021-08-31Apply suggestionsDeadbeef-3/+2
2021-08-31Report variant size without the discriminantDeadbeef-7/+13
2021-08-31Apply suggestionsDeadbeef-26/+18
2021-08-31Report Layout of enum variantsDeadbeef-1/+35
Followup of #83501, Fixes #86253.
2021-08-30Put back "auto-collapse-implementors" settingGuillaume Gomez-0/+1
2021-08-30Put back display of associated items (types and consts)Guillaume Gomez-11/+33
2021-08-29Use the correct type for Enum variant tuplesGuillaume Gomez-17/+24
2021-08-26Remove unnecessary copies when using parallel IOJoshua Nelson-38/+46
Previously, rustdoc was making lots of copies of temporary owned values. Now, it uses the owned value wherever possible.
2021-08-22Move Cache from Context to SharedContextJoshua Nelson-49/+38
2021-08-19Rollup merge of #88093 - Kobzol:rustdoc-wrap-code-in-code-tag, r=GuillaumeGomezGuillaume Gomez-261/+289
[rustdoc] Wrap code blocks in <code> tag This PR modifies Rustdoc output so that fenced code snippets, items and whole file source codes are wrapped in `<pre><code>` instead of just `<pre>`. This should improve the semantic meaning of the generated content. I'm not sure what to do about `render_attributes_in_pre` and `render_attributes_in_code`. These functions were clearly expected to be used for things inside `<pre>` or `<code>`, and since I added `<code>` in this PR, some of them will be used in a different context than before. However, it seems to me that even before they were not consistent. For example, `item_constant` used `render_attributes_in_code` for its attributes, however there was no `<code>` used for constants before this PR... Should I create some `rustdoc-gui` tests? For example to check that all `<pre>` tags have a `<code>` child? Fixes: https://github.com/rust-lang/rust/issues/88020
2021-08-19[rustdoc] Wrap code blocks in <code> tagJakub Beránek-261/+289
2021-08-16Rollup merge of #87178 - moxian:rd-use, r=jyn514Mara Bos-3/+2
[rustdoc] Copy only item path to clipboard rather than full `use` statement. The (somewhat) recent addition of the "copy item import to clipboard" button is extremely nice. However, i tend to write my code with fully qualified paths wherever feasible and only resort to `use` statements as a refactoring pass. This makes the "copy to clipboard" workflow awkward to use, as i would be copy-pasting that as, say ```rust impl use std::ops::Add; for MyType { ``` and then go back and remove the `use ` and `;`. This PR removes the `use ;` decorations, making it much nicer to use for fully-qualified items. I argue, however, that this does not noticeably degrade experience for those who prefer to import items, since the hard part about those is getting the path right, and writing the `use ;` decoration can be done by hand with little effort.
2021-08-05Remove LightSpan and use Span directlyGuillaume Gomez-57/+12
2021-08-05Remove warnings/errors from compiler when using typeck_body in rustdoc span ↵Guillaume Gomez-5/+5
map builder
2021-08-05* Rename LightSpan::empty into LightSpan::dummyGuillaume Gomez-1/+1
* Add Classifier::new_light_span to wrap LightSpan::new_in_file constructor
2021-08-05Add missing root_path when generating links using hrefGuillaume Gomez-0/+1
2021-08-05Add documentation and FIXMEGuillaume Gomez-4/+7
2021-08-05formattingGuillaume Gomez-14/+7
2021-08-05Use rustdoc Span in LinkFromSrc directlyGuillaume Gomez-4/+4
2021-08-05Move extra arguments for highlight URL generation into a new ContextInfo ↵Guillaume Gomez-2/+0
struct for better readability
2021-08-05Wrap the span_map tuple index into a type called "LightSpan"Guillaume Gomez-17/+58
2021-08-05Improve code readabilityGuillaume Gomez-2/+4
2021-08-05* Rename 'move_span' into 'local_span_to_global_span'Guillaume Gomez-0/+17
* Add documentation on new arguments/functions
2021-08-05Generate links for modules as wellGuillaume Gomez-5/+24
2021-08-05Generate links for methods as wellGuillaume Gomez-16/+36
2021-08-05Add an option for the source code link generationGuillaume Gomez-3/+12
2021-08-05Add links on source types to go to definitionGuillaume Gomez-26/+159
2021-08-04Rollup merge of #87720 - matthiaskrgr:clippy_into, r=jyn514Yuki Okushi-1/+1
don't use .into() to convert types to identical types (clippy::useless_conversion) Example: let _x: String = String::from("hello world").into();
2021-08-03Simplify usage of CSS background-imageGuillaume Gomez-6/+41
2021-08-03Rustdoc accessibility: use an icon for the [-]/[+] controlsMichael Howell-2/+5
This way, we can show the plus and minus buttons on screens, while voice control will read off actual words "Collapse" and "Expand" instead of reading "open brace minus close brace" and "open brace plus close brace". Part of #87059
2021-08-03don't use .into() to convert types to identical types ↵Matthias Krüger-1/+1
(clippy::useless_conversion) Example: let _x: String = String::from("hello world").into();
2021-07-29Rollup merge of #87451 - GuillaumeGomez:tuple-struct-field-doc, r=jyn514Yuki Okushi-12/+19
Add support for tuple struct field documentation Fixes #42615. This is #80320 updated to new codebase and with added tests. Part of https://github.com/rust-lang/rust/issues/83255. cc ```@camelid``` (since you were involved on the original PR). r? ```@jyn514```
2021-07-26Rollup merge of #87464 - camelid:rm-union-structhead, r=jyn514Guillaume Gomez-4/+2
Remove unnecessary `structhead` parameter from `render_union` `structhead` is used for `render_struct` so that the logic for rendering structs can be shared between struct variants and struct items. However, `render_union` is not used anywhere except for rendering union items, so its `structhead` parameter is unnecessary.
2021-07-26Add support for tuple struct fields documentation in enums as wellGuillaume Gomez-3/+7
2021-07-25Remove unnecessary `structhead` parameter from `render_union`Noah Lev-4/+2
`structhead` is used for `render_struct` so that the logic for rendering structs can be shared between struct variants and struct items. However, `render_union` is not used anywhere except for rendering union items, so its `structhead` parameter is unnecessary.
2021-07-25Auto merge of #87390 - notriddle:notriddle/rustdoc-headers-patch, ↵bors-13/+13
r=GuillaumeGomez Rustdoc accessibility: use real headers for doc items Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-25Rustdoc accessibility: use real headers for doc itemsbors-13/+13
Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-25Add support for tuple structs' fields documentationGuillaume Gomez-9/+12
2021-07-22Don't hide fields of enum struct variantsNoah Lev-4/+1
* The toggle adds visual clutter * It's easy to miss that there are fields * Tuple variant fields are always shown, so it is inconsistent to hide struct variant fields * It's annoying to have to click the toggle every time
2021-07-21Rollup merge of #87024 - weihanglo:issue-85494, r=ManishearthEric Huss-12/+34
rustdoc: show count of item contents when hidden Resolves #85494
2021-07-17Rustdoc accessibility: make the sidebar headers actual headersMichael Howell-29/+29
Part of #87059 Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
2021-07-16Auto merge of #86662 - mockersf:fix-86620-link-unknown-location, r=jyn514bors-8/+11
fix dead link for method in trait of blanket impl from third party crate fix #86620 * changes `href` method to raise the actual error it had instead of an `Option` * set the href link correctly in case of an error I did not manage to make a small reproducer, I think it happens in a situation where * crate A expose a trait with a blanket impl * crate B use the trait from crate A * crate C use types from crate B * building docs for crate C without dependencies r? `@jyn514`
2021-07-16Copy item path rather than full `use` statement.moxian-3/+2
2021-07-12Auto merge of #86841 - GuillaumeGomez:reexported-macro-2-render, r=Stupremeebors-2/+11
Fix rendering of reexported macros 2.0 and fix visibility of reexported items So, this PR grew a bit out of focus, it does the following things: * Fixes #86276. * Fixes visibility display for reexported items: it now takes the visibility of the "use" statement rather than the visibility of the reexported item itself). * Fixes the display of reexported items if "--document-private-items" option is used. Before, they were simply skipped. * Fixes inconsistency on typedef items: they didn't display their visibility contrary to other items. I added tests to check everything listed above. cc `@camelid` `@ollie27` (in case one of you want to review?) r? `@jyn514`