about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2017-11-22Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomezbors-4/+26
rustdoc: include external files in documentation (RFC 1990) Part of https://github.com/rust-lang/rfcs/pull/1990 (needs work on the error reporting, which i'm deferring to after this initial PR) cc #44732 Also fixes #42760, because the prep work for the error reporting made it easy to fix that at the same time.
2017-11-21allow loading external files in documentationQuietMisdreavus-4/+26
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990 (needs error reporting work) cc #44732
2017-11-22Rollup merge of #46134 - GuillaumeGomez:negative-traits, r=QuietMisdreavuskennytm-9/+19
Display negative traits implementation Fixes #45816. r? @QuietMisdreavus
2017-11-21Auto merge of #45039 - QuietMisdreavus:doc-spotlight, ↵bors-7/+74
r=GuillaumeGomez,QuietMisdreavus show in docs whether the return type of a function impls Iterator/Read/Write Closes #25928 This PR makes it so that when rustdoc documents a function, it checks the return type to see whether it implements a handful of specific traits. If so, it will print the impl and any associated types. Rather than doing this via a whitelist within rustdoc, i chose to do this by a new `#[doc]` attribute parameter, so things like `Future` could tap into this if desired. ### Known shortcomings ~~The printing of impls currently uses the `where` class over the whole thing to shrink the font size relative to the function definition itself. Naturally, when the impl has a where clause of its own, it gets shrunken even further:~~ (This is no longer a problem because the design changed and rendered this concern moot.) The lookup currently just looks at the top-level type, not looking inside things like Result or Option, which renders the spotlights on Read/Write a little less useful: <details><summary>`File::{open, create}` don't have spotlight info (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209495-e59d027e-a950-11e7-9998-ceefceb71c07.png) </details> All three of the initially spotlighted traits are generically implemented on `&mut` references. Rustdoc currently treats a `&mut T` reference-to-a-generic as an impl on the reference primitive itself. `&mut Self` counts as a generic in the eyes of rustdoc. All this combines to create this lovely scene on `Iterator::by_ref`: <details><summary>`Iterator::by_ref` spotlights Iterator, Read, and Write (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209554-50b271ca-a951-11e7-928b-4f83416c8681.png) </details>
2017-11-20Display negative traits implementationGuillaume Gomez-9/+19
2017-11-20Make rustdoc not include self-by-value methods from Deref targetFlorian Hartwig-5/+6
2017-11-18Add tooltip for important traits displayGuillaume Gomez-4/+9
2017-11-18Auto merge of #46000 - kennytm:fix-45640-extern-type-ice-in-rustdoc, ↵bors-2/+29
r=QuietMisdreavus Support `extern type` in rustdoc. Fixes #45640. (cc #43467)
2017-11-17Add trait methods as wellGuillaume Gomez-1/+2
2017-11-17Improve modal display and add JS eventsGuillaume Gomez-11/+6
2017-11-17First step for important traits UIGuillaume Gomez-13/+14
2017-11-17spotlight Iterator/Read/Write impls on function return typesQuietMisdreavus-7/+72
2017-11-15Escape doc root URLsLaurentiu Nicola-1/+1
2017-11-15Support `extern type` in rustdoc.kennytm-2/+29
Fixes #45640.
2017-11-12Generate generics on search-indexGuillaume Gomez-7/+29
2017-11-07Add more elements in the sidebarGuillaume Gomez-31/+139
2017-11-07Auto merge of #45620 - ollie27:rustdoc_impl_generic_dupe, r=QuietMisdreavusbors-4/+4
rustdoc: Fix duplicated impls with generics The same type can appear multiple times in impls so we need to use a set to avoid adding it multiple times. Fixes: #45584
2017-11-05Auto merge of #44042 - LukasKalbertodt:ascii-methods-on-instrinsics, ↵bors-0/+1
r=alexcrichton Copy all `AsciiExt` methods to the primitive types directly in order to deprecate it later **EDIT:** [this PR is ready now](https://github.com/rust-lang/rust/pull/44042#issuecomment-333883548). I edited this post to reflect the current status of discussion, which is (apart from code review) pretty much settled. --- This is my current progress in order to prepare stabilization of #39658. As discussed there (and in #39659), the idea is to deprecated `AsciiExt` and copy all methods to the type directly. Apparently there isn't really a reason to have those methods in an extension trait¹. ~~This is **work in progress**: copy&pasting code while slightly modifying the documentation isn't the most exciting thing to do. Therefore I wanted to already open this WIP PR after doing basically 1/4 of the job (copying methods to `&[u8]`, `char` and `&str` is still missing) to get some feedback before I continue. Some questions possibly worth discussing:~~ 1. ~~Does everyone agree that deprecating `AsciiExt` is a good idea? Does everyone agree with the goal of this PR?~~ => apparently yes 2. ~~Are my changes OK so far? Did I do something wrong?~~ 3. ~~The issue of the unstable-attribute is currently set to 0. I would wait until you say "Ok" to the whole thing, then create a tracking issue and then insert the correct issue id. Is that ok?~~ 4. ~~I tweaked `eq_ignore_ascii_case()`: it now takes the argument `other: u8` instead of `other: &u8`. The latter was enforced by the trait. Since we're not bound to a trait anymore, we can drop the reference, ok?~~ => I reverted this, because the interface has to match the `AsciiExt` interface exactly. ¹ ~~Could it be that we can't write `impl [u8] {}`? This might be the reason for `AsciiExt`. If that is the case: is there a good reason we can't write such an impl block? What can we do instead?~~ => we couldn't at the time this PR was opened, but Simon made it possible. /cc @SimonSapin @zackw
2017-11-03Remove unused AsciiExt imports and fix tests related to ascii methodsLukas Kalbertodt-0/+1
Many AsciiExt imports have become useless thanks to the inherent ascii methods added in the last commits. These were removed. In some places, I fully specified the ascii method being called to enforce usage of the AsciiExt trait. Note that some imports are not removed but tagged with a `#[cfg(stage0)]` attribute. This is necessary, because certain ascii methods are not yet available in stage0. All those imports will be removed later. Additionally, failing tests were fixed. The test suite should exit successfully now.
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-2/+2
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
2017-11-01Auto merge of #45187 - GuillaumeGomez:doc-ui-improvement, r=QuietMisdreavusbors-42/+104
Improve sidebar rendering and add methods list I suppose it can be reviewed as is, but this is just the first step of a more global plan. cc @rust-lang/docs @nical And a screenshot of course: <img width="1440" alt="screen shot 2017-10-10 at 23 38 45" src="https://user-images.githubusercontent.com/3050060/31412170-657beaf6-ae14-11e7-9f01-1e562a034595.png">
2017-10-29rustdoc: Fix duplicated impls with genericsOliver Middleton-4/+4
The same type can appear multiple times in impls so we need to use a set to avoid adding it multiple times.
2017-10-28Fix weird bugsGuillaume Gomez-31/+43
2017-10-27Encode urlsGuillaume Gomez-1/+17
2017-10-27Change sidebar items orderGuillaume Gomez-3/+3
2017-10-27Improve sidebar rendering and add methods listGuillaume Gomez-14/+48
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-1/+3
2017-10-16Display rustdoc pulldown switch warnings everytimeGuillaume Gomez-27/+22
2017-10-15Auto merge of #44613 - QuietMisdreavus:rustdoc-perf, r=michaelwoeristerbors-5/+22
some low-hanging rustdoc optimizations There were a few discussions earlier today in #rust-internals about the syscall usage and overall performance of rustdoc. This PR is intended to pick some low-hanging fruit and try to rein in some of the performance issues of rustdoc.
2017-10-13rustdoc: wrap redirect page writers in a BufWriterQuietMisdreavus-2/+4
2017-10-13rustdoc: don't create directories more than onceQuietMisdreavus-3/+18
2017-10-13Rollup merge of #44989 - QuietMisdreavus:what-is-your-quest, r=GuillaumeGomezkennytm-0/+14
let rustdoc print the crate version into docs This PR adds a new unstable flag to rustdoc, `--crate-version`, which when present will add a new entry to the sidebar of the root module, printing the given version number: ![Screenshot of a test crate, showing "Version 1.3.37" under the crate name](https://user-images.githubusercontent.com/5217170/31104096-805e3f4c-a7a0-11e7-96fc-368b6fe063d6.png) Closes #24336 (The WIP status is because i don't want to merge this until i can get the std docs to use it, which i need help from rustbuild people to make sure i get right.)
2017-10-12Auto merge of #44969 - QuietMisdreavus:impls-for-everyone, r=steveklabnikbors-8/+19
document trait impls when the type appears in the trait's generics Fixes #25264 ![image](https://user-images.githubusercontent.com/5217170/31062309-4fc7c594-a6ef-11e7-892e-07f95bbc7976.png)
2017-10-09let rustdoc print the crate version into docsQuietMisdreavus-0/+14
2017-10-01document trait impls when the type appears in the trait's genericsQuietMisdreavus-8/+19
2017-09-29rustdoc: Render [src] links for trait implementors (#43893)Vitaly _Vi Shukela-1/+10
2017-09-29rustdoc: Extract converter from Impementor to Item to a fnVitaly _Vi Shukela-13/+19
2017-09-23Rollup merge of #44554 - GuillaumeGomez:add-missing-pub, r=QuietMisdreavusCorey Farwell-2/+4
Add pub visibility for methods as well Fixes #44527. r? @QuietMisdreavus
2017-09-20Auto merge of #44350 - GuillaumeGomez:id-false-positive, r=QuietMisdreavusbors-24/+44
Improve how rustdoc warnings are displayed cc @rust-lang/dev-tools r? @nrc
2017-09-19Improve how warnings are displayedGuillaume Gomez-24/+44
2017-09-19Add pub visibility for methods as wellGuillaume Gomez-2/+4
2017-09-19Auto merge of #44026 - QuietMisdreavus:trimmed-std, r=steveklabnikbors-17/+29
hide internal types/traits from std docs via new #[doc(masked)] attribute Fixes #43701 (hopefully for good this time) This PR introduces a new parameter to the `#[doc]` attribute that rustdoc looks for on `extern crate` statements. When it sees `#[doc(masked)]` on such a statement, it hides traits and types from that crate from appearing in either the "Trait Implementations" section of many type pages, or the "Implementors" section of trait pages. This is then applied to the `libc`/`rand`/`compiler_builtins` imports in libstd to prevent those crates from creating broken links in the std docs. Like in #43348, this also introduces a feature gate, `doc_masked`, that controls the use of this parameter. To view the std docs generated with this change, head to https://tonberry.quietmisdreavus.net/std-43701/std/index.html.
2017-09-17Add more links and put the link character to the leftGuillaume Gomez-3/+5
2017-09-17Rollup merge of #44397 - GuillaumeGomez:codeblock-color, r=QuietMisdreavusTim Neumann-1/+4
Codeblock color <img width="1440" alt="screen shot 2017-09-07 at 21 53 58" src="https://user-images.githubusercontent.com/3050060/30183045-4319108e-9419-11e7-98da-da54952cab37.png"> This screenshot has been generated from: ```rust /// foo /// /// ```compile_fail /// foo(); /// ``` /// /// ```ignore /// goo(); /// ``` /// /// ``` /// let x = 0; /// ``` pub fn bar() -> usize { 2 } ``` r? @QuietMisdreavus cc @rust-lang/docs
2017-09-14Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavusCorey Farwell-2/+6
rustdoc: Don't counts ids twice when using --enable-commonmark cc @GuillaumeGomez r? @QuietMisdreavus
2017-09-12Fix rendering of const keyword for functionsGuillaume Gomez-17/+4
2017-09-11Add arrow and improve displayGuillaume Gomez-1/+2
2017-09-11Add class for codeblocksGuillaume Gomez-1/+3
2017-09-10Rollup merge of #44347 - GuillaumeGomez:rustdoc-false-positive, ↵Guillaume Gomez-3/+7
r=QuietMisdreavus Reduce false positives number in rustdoc html diff cc @rust-lang/dev-tools r? @nrc Very simple trick but should lighten html diff a bit
2017-09-10Rollup merge of #44329 - nrc:pulldown-warn-fix, r=ollie27Guillaume Gomez-80/+22
Fixup some nits from #44238 r? @ollie27