summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2020-11-16Add test to ensure that no DOS backline (\r\n) doesn't create extra backline ↵Guillaume Gomez-14/+27
in source rendering
2020-11-16Ensure that the source code display is working with DOS backlineGuillaume Gomez-0/+2
2020-09-23Use theme-adaptive SVG favicon from other Rust sitesJarek Samic-4/+34
2020-09-13Use `.as_str()` instead of `CowStr::Borrowed`Joshua Nelson-2/+2
2020-09-13Don't use `link.span` yetJoshua Nelson-1/+3
This shows the span of the _whole_ link, including the brackets. But rustdoc only wants to warn about the link text.
2020-09-13Upgrade to pulldown-cmark 0.8.0Joshua Nelson-16/+18
Thanks to marcusklaas' hard work in https://github.com/raphlinus/pulldown-cmark/pull/469, this fixes a lot of rustdoc bugs! - Get rid of unnecessary `RefCell` - Fix duplicate warnings for broken implicit reference link - Remove unnecessary copy of links
2020-09-09Auto merge of #76453 - camelid:fix-css-crate-list, r=GuillaumeGomez,ollie27bors-3/+4
rustdoc: Fix font CSS for crate lists I had put it in the wrong file in #76126. This should fix it now. Thank you to `@ollie27` for pointing this out! --- `@rustbot` modify labels: T-rustdoc C-bug
2020-09-09Rollup merge of #76374 - pickfire:patch-4, r=CldfireDylan DPC-2/+3
Improve ayu doc source line number contrast Improve contrast of foreground line number. Before ![image](https://user-images.githubusercontent.com/4687791/92305696-1bf2ab80-efbc-11ea-8b5c-a24c4f6261e0.png) After ![image](https://user-images.githubusercontent.com/4687791/92305700-2a40c780-efbc-11ea-9061-dbfcb1e71980.png) r? @Cldfire I think we should add the line for light and dark theme too, it looks better and clearer that way.
2020-09-07rustdoc: Fix font CSS for crate listsCamelid-3/+4
I had put it in the wrong file in #76126. This should fix it now. Thank you to @ollie27 for pointing this out!
2020-09-05Rollup merge of #76078 - jyn514:no-disambiguator, r=manishearthDylan DPC-24/+100
Remove disambiguators from intra doc link text Closes https://github.com/rust-lang/rust/issues/65354. r? @Manishearth The commits are mostly atomic, but there might be some mix between them here and there. I recommend reading 'refactor ItemLink' and 'refactor RenderedLink' on their own though, lots of churn without any logic changes.
2020-09-05Improve ayu doc source line number contrastIvan Tham-2/+3
Improve contrast of foreground line number.
2020-09-04Misc cleanupJoshua Nelson-23/+42
- Preserve suffixes when displaying - Rename test file to match `intra-link*` - Remove unnecessary .clone()s - Improve comments and naming - Fix more bugs and add tests - Escape intra-doc link example in public documentation
2020-09-03Auto merge of #73819 - euclio:rustdoc-summaries, r=jyn514,GuillaumeGomezbors-68/+68
rustdoc: do not use plain summary for trait impls Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474. Unfortunately this is not quite ready to go because the newly-working links trigger a bunch of linkcheck failures. The failures are tough to fix because the links are resolved relative to the implementor, which could be anywhere in the module hierarchy. (In the current docs, these links end up rendering as uninterpreted markdown syntax, so I don't think these failures are any worse than the status quo. It might be acceptable to just add them to the linkchecker whitelist.) Ideally this could be fixed with intra-doc links ~~but it isn't working for me: I am currently investigating if it's possible to solve it this way.~~ Opened #73829. EDIT: This is now ready!
2020-09-03Remove disambiguators from link textJoshua Nelson-18/+74
Related to https://github.com/rust-lang/rust/issues/65354 - Pass through the replacement text to `markdown.rs` - Add some tests - Add a state machine that actually replaces the text when parsing Markdown
2020-09-03Refactor RenderedLink into its own typeJoshua Nelson-12/+13
2020-09-01Use "Fira Sans" for crate list fontCamelid-2/+6
Fira Sans is what's used for module lists and other item lists. Previously, the default body font, "Source Serif Pro", was used for crate lists, which didn't visually match other item lists.
2020-08-31Rollup merge of #76178 - matklad:et, r=Mark-SimulacrumTyler Mandry-1/+1
Update expect-test to 1.0 The only change is that `expect_file` now uses path relative to the current file (same as `include!`). Before, it used paths relative to the workspace root, which makes no sense.
2020-08-31Rollup merge of #76154 - GuillaumeGomez:strings-indent, r=jyn514Tyler Mandry-118/+99
Fix rustdoc strings indentation I took the opportunity to clean up our strings indentation a bit because it was a bit messy. r? @jyn514
2020-08-31Update expect-test to 1.0Aleksey Kladov-1/+1
The only change is that `expect_file` now uses path relative to the current file (same as `include!`). Before, it used paths relative to the workspace root, which makes no sense.
2020-08-31Fix stringGuillaume Gomez-1/+1
2020-08-31Fix strings indentGuillaume Gomez-118/+99
2020-08-31Rollup merge of #76052 - ↵Aleksey Kladov-4/+8
aszenz:GH-66816_removes_disable_attribute_before_return, r=GuillaumeGomez GH-66816: Remove disable attr before return Passing --disable-per-crate-search removes the create search inputs so moved code around so that the search input is enabled first before the function returns. Fixes #66816
2020-08-30rustdoc: do not use plain summary for trait implsAndy Russell-68/+68
Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474.
2020-08-30Auto merge of #75901 - ↵bors-1/+1
GuillaumeGomez:ayu-theme-button-hover-background-color, r=pickfire Improve theme button hover background color Fixes #75880. ![Screenshot from 2020-08-25 13-44-01](https://user-images.githubusercontent.com/3050060/91170922-e60b1880-e6d9-11ea-9eb1-61a44cdc28d9.png) ![Screenshot from 2020-08-25 13-43-43](https://user-images.githubusercontent.com/3050060/91170924-e73c4580-e6d9-11ea-969e-616bf4130975.png) r? @pickfire
2020-08-30Auto merge of #76090 - Dylan-DPC:rollup-eksndcr, r=Dylan-DPCbors-9/+10
Rollup of 14 pull requests Successful merges: - #75832 (Move to intra-doc links for wasi/ext/fs.rs, os_str_bytes.rs…) - #75852 (Switch to intra-doc links in `core::hash`) - #75874 (Shorten liballoc doc intra link while readable) - #75881 (Expand rustdoc theme chooser x padding) - #75885 (Fix another clashing_extern_declarations false positive.) - #75892 (Fix typo in TLS Model in Unstable Book) - #75910 (Add test for issue #27130) - #75917 (Move to intra doc links for core::ptr::non_null) - #75975 (Allow --bess ing expect-tests in tools) - #75990 (Add __fastfail for Windows on arm/aarch64) - #76015 (Fix loading pretty-printers in rust-lldb script) - #76022 (Clean up rustdoc front-end source code) - #76029 (Move to intra-doc links for library/core/src/sync/atomic.rs) - #76057 (Move retokenize hack to save_analysis) Failed merges: r? @ghost
2020-08-30Rollup merge of #76022 - GuillaumeGomez:cleanup-rustdoc-front, r=jyn514Dylan DPC-8/+9
Clean up rustdoc front-end source code r? @jyn514
2020-08-30Rollup merge of #75881 - pickfire:patch-5, r=GuillaumeGomezDylan DPC-1/+1
Expand rustdoc theme chooser x padding ![image](https://user-images.githubusercontent.com/4687791/91057476-d0eea500-e659-11ea-8c9a-e44db937da89.png) ![image](https://user-images.githubusercontent.com/4687791/91057530-e368de80-e659-11ea-9298-fbb00006d91f.png) But I still think there is room for improvement considering mdbook. ![image](https://user-images.githubusercontent.com/4687791/91057583-f7acdb80-e659-11ea-9dc5-317caed92bc5.png) CC @GuillaumeGomez @jyn514
2020-08-29Auto merge of #75775 - matklad:rustc-lexer-rustdoc-highlight, r=GuillaumeGomezbors-408/+288
Use rustc_lexer for rustdoc syntax highlighting r? @ghost
2020-08-29Use an id instead of a functionGuillaume Gomez-6/+3
2020-08-29GH-66816: Process before enabling searchasrar-2/+5
2020-08-29GH-66816: Removes disable before returnasrar-3/+4
Passing --disable-per-crate-search removes the create search inputs so moved code around so that the search input is enabled first before the function returns
2020-08-28Clean up rustdoc front-end source codeGuillaume Gomez-8/+12
2020-08-28Rollup merge of #75989 - matklad:renamerustdoctest, r=GuillaumeGomezPietro Albini-3/+3
Rename rustdoc/test -> rustdoc/doctest This modules contains the implementation of doctests, and not the tests of rustdoc itself. This name is confusing, so let's rename it to doctest for clarity.
2020-08-28Rollup merge of #75330 - Nemo157:improve-doc-cfg-features, r=GuillaumeGomezPietro Albini-5/+5
Improve rendering of crate features via doc(cfg) The current rendering of crate features with `doc(cfg(feature = ".."))` is verbose and unwieldy for users, `doc(cfg(target_feature = ".."))` is special-cased to make it render nicely, and a similar rendering can be applied to `doc(cfg(feature))` to make it easier for users to read. I also added special casing of `all`/`any` cfgs consisting of just `feature`/`target-feature` to remove the repetitive "target/crate feature" prefix. The downside of this current rendering is that there is no distinction between `feature` and `target_feature` in the shorthand display. IMO this is ok, or if anything `target_feature` should have a more verbose shorthand, because `doc(cfg(feature = ".."))` usage is going to vastly outstrip `doc(cfg(target_feature = ".."))` usage in non-stdlib crates when it eventually stabilizes (or even before that given the number of crates using `cfg_attr(docsrs)` like constructs). ## Previously <img width="259" alt="Screenshot 2020-08-09 at 13 32 42" src="https://user-images.githubusercontent.com/81079/89731110-d090c000-da44-11ea-96fa-56adc6339123.png"> <img width="438" alt="image" src="https://user-images.githubusercontent.com/81079/89731116-d7b7ce00-da44-11ea-87c6-022d192d6eca.png"> <img width="765" alt="image" src="https://user-images.githubusercontent.com/81079/89731152-24030e00-da45-11ea-9552-1c270bff2729.png"> <img width="671" alt="image" src="https://user-images.githubusercontent.com/81079/89731158-28c7c200-da45-11ea-8acb-97d8a4ce00eb.png"> ## Now <img width="216" alt="image" src="https://user-images.githubusercontent.com/81079/89731123-e1d9cc80-da44-11ea-82a8-5900bd9448a5.png"> <img width="433" alt="image" src="https://user-images.githubusercontent.com/81079/89731127-e8684400-da44-11ea-9d18-572fd810f19f.png"> <img width="606" alt="image" src="https://user-images.githubusercontent.com/81079/89731162-2feed000-da45-11ea-98d2-8a88c364d903.png"> <img width="669" alt="image" src="https://user-images.githubusercontent.com/81079/89731991-ccb46c00-da4b-11ea-9416-cd20a3193826.png"> cc #43781
2020-08-27Auto merge of #75976 - GuillaumeGomez:help-popup, r=jyn514bors-4/+5
Improve help popup Fixes #75623. The second commit is just a slight improvement: the help popup won't be created until someone presses "?" or ESC. Not a big improvement in itself but considering the low amount of code required, I think it was worth the shot. r? @jyn514
2020-08-27Add expect test for rustdoc html highlightingAleksey Kladov-61/+63
It's a unit-test in a sense that it only checks syntax highlighting. However, the resulting HTML is written to disk and can be easily inspected in the browser. To update the test, run with `--bless` argument or set `UPDATE_EXPEC=1` env var
2020-08-27Rename rustdoc/test -> rustdoc/doctestAleksey Kladov-3/+3
This modules contains the implementation of doctests, and not the tests of rustdoc itself. This name is confusing, so let's rename it to doctest for clarity.
2020-08-27Remove dependency on StringReader from rustdoc highlighterAleksey Kladov-350/+228
rustc_lexer is the lossless lexer, which is a better fit for approximate syntax highlighting. As a side-effect, we can now syntax-highlight even broken code.
2020-08-27Delay help popup creation to when it's neededGuillaume Gomez-2/+3
2020-08-27Improve helper wordingGuillaume Gomez-2/+2
2020-08-27Auto merge of #75842 - camelid:highlight-crate-links, r=jyn514bors-1/+5
Highlight crate links like normal links Fixes #75823. Cc @jyn514
2020-08-27Rollup merge of #75870 - GuillaumeGomez:unify-border-color-theme-ayu, r=pickfireDylan DPC-1/+1
Unify theme choices border color in ayu theme There was a slight color difference in the theme choice menu borders: ![Screenshot from 2020-08-24 10-37-05](https://user-images.githubusercontent.com/3050060/91022913-22654880-e5f6-11ea-8165-302b2d4e701e.png) ![Screenshot from 2020-08-24 10-37-58](https://user-images.githubusercontent.com/3050060/91022918-242f0c00-e5f6-11ea-989a-e26a28196d09.png) r? @Cldfire
2020-08-27Rollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=CldfireDylan DPC-0/+2
Fix font color for help button in ayu and dark themes A nice before/after: ![Screenshot from 2020-08-23 14-47-07](https://user-images.githubusercontent.com/3050060/90979230-0dd07400-e554-11ea-85f7-046dfca65e8e.png) ![Screenshot from 2020-08-23 14-47-03](https://user-images.githubusercontent.com/3050060/90979233-145eeb80-e554-11ea-8e63-1864c3f2699b.png) For the ayu theme, the change is very "light", the font color was already close to white, so I unified the color with the pictures of the other buttons: ![Screenshot from 2020-08-23 15-20-45](https://user-images.githubusercontent.com/3050060/90979281-5e47d180-e554-11ea-9993-8595057481ab.png) ![Screenshot from 2020-08-23 15-20-50](https://user-images.githubusercontent.com/3050060/90979279-5daf3b00-e554-11ea-8d39-beb57091aba7.png)
2020-08-27Rollup merge of #75806 - ↵Dylan DPC-4/+14
GuillaumeGomez:prevent-automatic-page-change-history, r=pickfire Prevent automatic page change when using history Fixes #75774.
2020-08-25Improve theme button hover background colorGuillaume Gomez-1/+1
2020-08-24Expand rustdoc theme chooser x paddingIvan Tham-1/+1
2020-08-24Add explanations on the results search element checkGuillaume Gomez-0/+3
2020-08-24Unify theme choices border color in ayu themeGuillaume Gomez-1/+1
2020-08-23Highlight crate links like normal linksCamelid-1/+5
2020-08-23Fix font color for help button in ayu and dark themesGuillaume Gomez-0/+2