summary refs log tree commit diff
path: root/src/librustdoc/html/render
AgeCommit message (Collapse)AuthorLines
2020-09-23Use theme-adaptive SVG favicon from other Rust sitesJarek Samic-1/+3
2020-09-05Rollup merge of #76078 - jyn514:no-disambiguator, r=manishearthDylan DPC-4/+3
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-03Auto merge of #73819 - euclio:rustdoc-summaries, r=jyn514,GuillaumeGomezbors-32/+36
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-2/+1
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-2/+2
2020-09-01Use "Fira Sans" for crate list fontCamelid-2/+3
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-31Fix strings indentGuillaume Gomez-91/+78
2020-08-30rustdoc: do not use plain summary for trait implsAndy Russell-32/+36
Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474.
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 #75842 - camelid:highlight-crate-links, r=jyn514bors-1/+5
Highlight crate links like normal links Fixes #75823. Cc @jyn514
2020-08-23Highlight crate links like normal linksCamelid-1/+5
2020-08-22rustdoc: Rename misleading functionJoshua Nelson-1/+1
- `is_associated` -> `is_type_alias` `is_associated` is not a good name for what this is doing. If you look at https://github.com/rust-lang/rust/pull/74489/files#diff-6a301d597807ee441a41e7237800563dR296, is_associated() and as_assoc_kind() do completely different things, but from the name it sounds like they're similar.
2020-08-19Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514Yuki Okushi-2/+4
Add doc examples coverage r? @jyn514
2020-08-18Add long cfg description to tooltip on short descriptionWim Looman-5/+5
2020-08-18Add doc examples count for --show-coverageGuillaume Gomez-2/+4
2020-08-11Rollup merge of #75378 - petrochenkov:isident, r=Mark-SimulacrumTyler Mandry-15/+15
Introduce `rustc_lexer::is_ident` and use it in couple of places Implements the suggestion from https://github.com/rust-lang/rust/pull/74537#issuecomment-662261979.
2020-08-11Rollup merge of #75347 - fusion-engineering-forks:rustdoc-nat-sort, ↵Yuki Okushi-29/+63
r=GuillaumeGomez Rustdoc: Fix natural ordering to look at all numbers. The old implementation only looks at numbers at the end, but not in other places in a name: `u8` and `u16` got sorted properly, but `u8_bla` and `u16_bla` did not. ![image](https://user-images.githubusercontent.com/783247/89740226-28e8b180-da87-11ea-885d-77a7c8a6ba00.png)
2020-08-11Feature gate is always presentMark Rousskov-15/+15
2020-08-09Rustdoc: Fix natural ordering to look at all numbers.Mara Bos-29/+63
The old implementation only looks at numbers at the end, but not in other places in a name: "u8" and "u16" got sorted properly, but "u8_bla" and "u16_bla" did not.
2020-08-09Rename "Important traits" to "Notable traits"Camelid-2/+2
* Rename it in the UI * Rename the CSS classes
2020-08-04rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`Vadim Petrochenkov-1/+1
For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc
2020-07-29Pass by valueJoseph Ryan-1/+1
2020-07-29Refactor DocFS to fix error handling bugsJoseph Ryan-7/+10
2020-07-27More requested changesJoseph Ryan-3/+3
2020-07-27Make requested changesJoseph Ryan-4/+2
2020-07-27Pull out more types from htmlJoseph Ryan-13/+2
2020-07-27Extract `Cache` and other types from `html` moduleJoseph Ryan-489/+4611
2020-07-27Move `Error` and `RenderInfo` out of `html` moduleJoseph Ryan-1/+2
2020-06-26Generate docs for links to private items when passed --document-privateJoshua Nelson-0/+6
- Pass around document_private a lot more - Add tests + Add tests for intra-doc links to private items + Add ignored tests for warnings in reference links
2020-05-29Split payload of FileName::Real to track both real and virutalized paths.Felix S. Klock II-1/+1
Such splits arise from metadata refs into libstd. This way, we can (in a follow on commit) continue to emit the virtual name into things like the like the StableSourceFileId that ends up in incremetnal build artifacts, while still using the devirtualized file path when we want to access the file. Note that this commit is intended to be a refactoring; the actual fix to the bug in question is in a follow-on commit.
2020-05-14* Update aliases data struct from HashMap to BTreeMap to have more ↵Guillaume Gomez-9/+7
deterministic results * Update Javascript to take this change into account * Update CrateData::aliases field to take a reference instead (it allowed to remove a conversion loop)
2020-05-14Move doc alias discovery into the Attributes struct and some code improvementsGuillaume Gomez-37/+4
2020-05-07Merge aliases and search-indexGuillaume Gomez-21/+23
2020-05-07Improve doc alias discoveryGuillaume Gomez-36/+53
2020-04-20Rollup merge of #71250 - GuillaumeGomez:use-json-instead-of-js, r=kinnisonDylan DPC-1/+6
Replace big JS dict with JSON parsing Part of #56545. @ollie27 suggested that using JSON instead of a JS dict might be faster, so I decided to test it. And the results far exceeded whatever expectations I had... I used https://github.com/adamgreig/stm32ral for my tests. If you want to build it locally: ```bash $ cargo doc --features doc --open ``` But I strongly recommend to do it with this PR. Some numbers: * Loading a page with the JSON search-index: less than 1 second * Loading a page with the JS search-index: crashed after 30 seconds I think the results are clear enough... r? @ollie27 cc @rust-lang/rustdoc
2020-04-17Replace big JS dict with JSON parsingGuillaume Gomez-1/+6
2020-04-16Dogfood or_patterns in rustdocJosh Stone-4/+7
2020-04-10Improve rustdoc source code a bitGuillaume Gomez-5/+5
2020-03-31more clippy fixesMatthias Krüger-1/+1
use is_empty() instead of len comparison (clippy::len_zero) use if let instead of while let loop that never loops (clippy::never_loop) remove redundant returns (clippy::needless_return) remove redundant closures (clippy::redundant_closure) use if let instead of match and wildcard pattern (clippy::single_match) don't repeat field names redundantly (clippy::redundant_field_names)
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-1/+1
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-1/+1
2020-03-22don't create variable bindings just to return the bound value immediately ↵Matthias Krüger-3/+2
(clippy::let_and_return)
2020-03-16Rename render::Type to improve namingGuillaume Gomez-3/+3
2020-03-16formattingGuillaume Gomez-17/+19
2020-03-16Support type search for arguments and returned typesGuillaume Gomez-18/+29
2020-03-02Put back output-format option for show-coverageGuillaume Gomez-0/+1
2020-02-29use .iter() instead of .into_iter() on references.Matthias Krüger-1/+1
2020-02-27use char instead of &str for single char patternsMatthias Krüger-2/+2
2020-01-30rustdoc: NodeId is now DefIdTom Jakubowski-16/+11
2020-01-15remove unneeded code from cache.rsGuillaume Gomez-14/+6