about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2021-07-27Auto merge of #83484 - JulianKnodt:infer, r=oli-obk,lcnrbors-0/+1
Add hir::GenericArg::Infer In order to extend inference to consts, make an Infer type on hir::GenericArg.
2021-07-26Pass correct line number for indented code blocks.Abdalrhman Mohamed-1/+29
2021-07-26Rollup merge of #87474 - GuillaumeGomez:missing-whitespace-after-attr, ↵Guillaume Gomez-1/+1
r=notriddle Add missing whitespace after attribute in HTML template Firefox (even though it worked) highlights it as red when you look at the source code because there is a missing whitespace. r? `@notriddle`
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-26Rollup merge of #87444 - camelid:flatten-nested-format, r=jyn514Guillaume Gomez-2/+2
Flatten nested `format!` calls
2021-07-26Add missing whitespace after attribute in HTML templateGuillaume Gomez-1/+1
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-22/+30
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-22/+30
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-25don't slice slices (clippy::redundant_slicing)Matthias Krüger-2/+2
2021-07-25Add generic arg inferkadmin-0/+1
2021-07-25Auto merge of #87331 - camelid:summary-escaping, r=GuillaumeGomezbors-4/+13
Escape item search summaries I noticed that `Pin::new()`'s search summary looked off, and I realized that the reason is that it has inline code containing `Pin<P>`, which is not escaped and thus renders as a paragraph tag!
2021-07-24Flatten nested `format!` callsNoah Lev-2/+2
2021-07-24Escape item search summariesNoah Lev-4/+13
I noticed that `Pin::new()`'s search summary looked off, and I realized that the reason is that it has inline code containing `Pin<P>`, which is not escaped and thus renders as a paragraph tag!
2021-07-23Rollup merge of #87376 - Thomasdezeeuw:rustdoc-large-logo, r=GuillaumeGomezYuki Okushi-0/+1
Change rustdoc logo to use the full container size We have a logo in svg that scales nicely to large sizes, but by default is only 5px large, i.e. very small. With the change the logo expands to the full size. By only setting the height to 100% we ensure that the width-height ratio isn't changed.
2021-07-22Don't hide fields of enum struct variantsNoah Lev-5/+2
* 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-22Change rustdoc logo to use the full container sizeThomas de Zeeuw-0/+1
We have a logo in svg that scales nicely to large sizes, but by default is only 5px large, i.e. very small. With the change the logo expands to the full size. By only setting the height to 100% we ensure that the width-height ratio isn't changed.
2021-07-22Rollup merge of #87288 - ijackson:rustdoc-theme, r=GuillaumeGomezGuillaume Gomez-0/+2
rustdoc: Restore --default-theme, etc, by restoring varname escaping In #86157 cd0f93193c84ddc6698f9b65909da71c084dcb74 Use Tera templates for rustdoc. dropped the following transformation from the keys of the default settings element's `data-` attribute names: .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v))) The `Escape` part is indeed no longer needed, because Tera does that for us. But the massaging of `-` to `_` is needed, for the (bizarre) reasons explained in the new comments. I have tested that the default theme function works again for me. I have also verified that passing (in shell syntax) '--default-theme="zork&"' escapes the value in the HTML. Closes #87263
2021-07-22Rollup merge of #87270 - GuillaumeGomez:item-summary-table, r=notriddleGuillaume Gomez-4/+11
Don't display <table> in item summary Fixes #87231. r? `@notriddle`
2021-07-21Don't render <table> in items' summaryGuillaume Gomez-4/+11
2021-07-21rustdoc: Restore --default-theme, etc, by restoring varname escapingIan Jackson-0/+2
In #86157 cd0f93193c84ddc6698f9b65909da71c084dcb74 Use Tera templates for rustdoc. dropped the following transformation from the keys of the default settings element's `data-` attribute names: .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v))) The `Escape` part is indeed no longer needed, because Tera does that for us. But the massaging of `-` to `_` is needed, for the (bizarre) reasons explained in the new comments. I have tested that the default theme function works again for me. I have also verified that passing --default-theme="zork&" escapes the value in the HTML. Closes #87263. CC: Jacob Hoffman-Andrews <github@hoffman-andrews.com> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
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-21Rollup merge of #87230 - GuillaumeGomez:docblock-table-overflow, r=notriddleGuillaume Gomez-4/+5
Fix docblock <table> overflow Before: ![Screenshot from 2021-07-18 00-05-23](https://user-images.githubusercontent.com/3050060/126050272-ce08bc5f-74ff-4135-bc12-d708d87470cc.png) After: ![Screenshot from 2021-07-18 00-03-55](https://user-images.githubusercontent.com/3050060/126050273-42f41b4d-ad57-4a87-91de-18e63f8504ec.png) cc `@SergioBenitez` r? `@notriddle`
2021-07-19Rollup merge of #87251 - GuillaumeGomez:item-info-width, r=notriddleGuillaume Gomez-0/+3
Fix "item info" width Fixes #87202. It now looks again like this: ![Screenshot from 2021-07-18 12-33-27](https://user-images.githubusercontent.com/3050060/126064005-013acabc-7f17-4436-8dfc-cb6b9bc24413.png) cc `@jyn514` r? `@notriddle`
2021-07-18Fix item info displayGuillaume Gomez-0/+3
2021-07-18Fix <table> overflow in doc blocksGuillaume Gomez-4/+5
2021-07-17Remove redundant CSSMichael Howell-1/+0
2021-07-17Rustdoc accessibility: make the sidebar headers actual headersMichael Howell-29/+34
Part of #87059 Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
2021-07-16Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, ↵Guillaume Gomez-1/+2
r=GuillaumeGomez feat(rustdoc): open sidebar menu when links inside it are focused Fixes #87172 Based on #87167 (which should be merged first) r? ``@GuillaumeGomez`` Preview it at https://notriddle.com/notriddle-rustdoc-test/std/index.html
2021-07-16feat(rustdoc): open sidebar menu when links inside it are focusedMichael Howell-1/+2
Fixes #87172 Based on #87167 (which should be merged first) Preview it at https://notriddle.com/notriddle-rustdoc-test/std/index.html Co-authored-by: Guillaume Gomez <guillaume.gomez@huawei.com>
2021-07-16Auto merge of #87182 - GuillaumeGomez:rollup-whwohua, r=GuillaumeGomezbors-4/+9
Rollup of 7 pull requests Successful merges: - #86983 (Add or improve natvis definitions for common standard library types) - #87069 (ExprUseVisitor: Treat ByValue use of Copy types as ImmBorrow) - #87138 (Correct invariant documentation for `steps_between`) - #87145 (Make --cap-lints and related options leave crate hash alone) - #87161 (RFC2229: Use the correct place type) - #87162 (Fix type decl layout "overflow") - #87167 (Fix sidebar display on small devices) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-16Rollup merge of #87167 - GuillaumeGomez:sidebar-display-mobile, r=notriddleGuillaume Gomez-4/+6
Fix sidebar display on small devices Part of #87059. Instead of hiding the sidebar on small devices, we instead move it out of the viewport so that it remains "visible" to our text only users. Could you confirm it works for you `@ahicks92` and `@DataTriny` please? You can give it a try at [this URL](https://guillaume-gomez.fr/rustdoc-test/test_docs/index.html). r? `@notriddle`
2021-07-16Rollup merge of #87162 - GuillaumeGomez:type-decl-overflow, r=notriddleGuillaume Gomez-0/+3
Fix type decl layout "overflow" Before: ![Screenshot from 2021-07-15 17-56-12](https://user-images.githubusercontent.com/3050060/125822644-c4595211-d75e-4dd7-ba44-183197ee836c.png) After: ![Screenshot from 2021-07-15 17-56-17](https://user-images.githubusercontent.com/3050060/125822648-7b363847-e153-4ff3-9fba-59478e32eced.png) cc ```@SergioBenitez``` r? ```@notriddle```
2021-07-16Auto merge of #86662 - mockersf:fix-86620-link-unknown-location, r=jyn514bors-30/+48
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-4/+3
2021-07-15Do not hide the sidebar on mobile, move it outside of the viewport insteadGuillaume Gomez-4/+6
2021-07-15Fix layout overflow in type declarationGuillaume Gomez-0/+3
2021-07-15Fix misuse of rev attribute on <a> tagGuillaume Gomez-2/+1
2021-07-14Rollup merge of #87125 - GuillaumeGomez:ayu-code-color, r=notriddleGuillaume Gomez-1/+1
Fix Ayu theme <code> color Fixes #87072 (the second regression). r? `@notriddle`
2021-07-14Rollup merge of #87056 - GuillaumeGomez:fix-codeblocks-overflow, r=notriddleGuillaume Gomez-19/+34
Fix codeblocks overflow Fixes #87043. Instead of completely relying on `pulldown-cmark` (and its potential changes), I decided to move the generation of codeblocks HTML directly in rustdoc so we can unify the DOM and the CSS classes. r? `@Nemo157`
2021-07-14Fix color for <code> which are not in doc blocksGuillaume Gomez-1/+1
2021-07-14Fix display for non-rust code blocksGuillaume Gomez-19/+34
2021-07-13Fix color for keyword/primitive search resultGuillaume Gomez-3/+3
2021-07-13Fix search result description text color for ayu themeGuillaume Gomez-1/+1
2021-07-13Rollup merge of #87035 - GuillaumeGomez:fix-implementors-display, r=notriddleYuki Okushi-4/+14
Fix implementors display Part of https://github.com/rust-lang/rust/issues/86632. This PR does a few things: * It fixes of the JS rendered implementors. * It generates anchors for JS rendered implementors to make it coherent with the others. * It adds a test to ensure that we won't have the same issue again. * It changes the way we render the rustdoc-gui crates to simplify it a bit and also to allow to have dependencies without going through compiletest. Before: ![Screenshot from 2021-07-10 13-30-13](https://user-images.githubusercontent.com/3050060/125174172-b4048700-e1c3-11eb-8f0e-c46081371d4f.png) After: ![Screenshot from 2021-07-10 21-11-15](https://user-images.githubusercontent.com/3050060/125174173-b49d1d80-e1c3-11eb-8740-1dbbff70c2eb.png) I plan to add the `[src]` links in another PR because this one is already big enough. cc `@Mark-Simulacrum` (for the bootstrap changes) r? `@Nemo157`
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`
2021-07-11rustdoc: show count of item contents when hiddenWeihang Lo-12/+34
2021-07-11comment about link without a hrefFrançois Mockers-0/+1