about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2017-09-06rustdoc: Don't counts ids twice when using --enable-commonmarkOliver Middleton-2/+6
2017-09-06Reduce false positives number in rustdoc html diffGuillaume Gomez-3/+7
2017-09-06Fixup some nits from #44238Nick Cameron-80/+22
2017-09-05new attribute #[doc(masked)] to hide internal crates from std docsQuietMisdreavus-17/+29
2017-09-05add "Implementations on Foreign Types" to the sidebarQuietMisdreavus-0/+11
2017-09-05if not showing default docs on an impl, autohide the itemsQuietMisdreavus-0/+9
2017-09-05rustdoc: add new "Implementations on Foreign Types" section to traitsQuietMisdreavus-14/+56
2017-09-01Windows line endingsNick Cameron-1/+1
2017-09-01Do a better job of eliding whitespace-only differences from warningsNick Cameron-1/+67
2017-09-01Improve the appearance of markdown warningsNick Cameron-14/+98
2017-09-01rustdoc: collect rendering warnings and print them in one placeNick Cameron-16/+34
2017-09-01Only emit warnings if the user is using PulldownNick Cameron-25/+32
Also checks for differences after eliminating whitespace-only diffs. Renames get_html_diff
2017-08-31Auto merge of #41991 - GuillaumeGomez:rustdoc-html-diff, r=nrcbors-2/+31
Add warnings when rustdoc html rendering differs
2017-08-30Remove some false positive issuesGuillaume Gomez-1/+9
2017-08-30Print warning whatever the rendering modeGuillaume Gomez-26/+15
2017-08-30Update unstable-crate testGuillaume Gomez-7/+8
2017-08-30Add warnings when rustdoc html rendering differsGuillaume Gomez-2/+33
2017-08-28Fix invalid linker positionGuillaume Gomez-4/+2
2017-08-26Rollup merge of #43979 - Jouan:Add-links-for-impls, r=GuillaumeGomezCorey Farwell-1/+7
Add links for impls Implements a solution for issue #23552 r? @QuietMisdreavus
2017-08-24Remove duplicates in rustdocGuillaume Gomez-0/+31
2017-08-18Add links for implsJouan Amate-1/+7
Implements a solution for issue #23552
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-15/+15
Like #43008 (f668999), but _much more aggressive_.
2017-08-13Auto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichtonbors-0/+8
Expose all OS-specific modules in libstd doc. 1. Uses the special `--cfg dox` configuration passed by rustbuild when running `rustdoc`. Changes the `#[cfg(platform)]` into `#[cfg(any(dox, platform))]` so that platform-specific API are visible to rustdoc. 2. Since platform-specific implementations often won't compile correctly on other platforms, `rustdoc` is changed to apply `everybody_loops` to the functions during documentation and doc-test harness. 3. Since platform-specific code are documented on all platforms now, it could confuse users who found a useful API but is non-portable. Also, their examples will be doc-tested, so must be excluded when not testing on the native platform. An undocumented attribute `#[doc(cfg(...))]` is introduced to serve the above purposed. Fixes #24658 (Does _not_ fully implement #1998).
2017-08-12Auto merge of #43736 - ollie27:rustdoc_impls_js, r=QuietMisdreavusbors-0/+12
rustdoc: Don't add external impls to implementors js Otherwise impls from not documented crates appear. Fixes #43701
2017-08-10Implemented #[doc(cfg(...))].kennytm-0/+8
This attribute has two effects: 1. Items with this attribute and their children will have the "This is supported on **** only" message attached in the documentation. 2. The items' doc tests will be skipped if the configuration does not match.
2017-08-08Improve headers linkingGuillaume Gomez-22/+22
2017-08-08rustdoc: Don't add external impls to implementors jsOliver Middleton-0/+12
Otherwise impls from not documented crates appear.
2017-07-30Auto merge of #43515 - QuietMisdreavus:show-assoc-types, r=GuillaumeGomezbors-0/+7
rustdoc: print associated types in traits "implementors" section When viewing a trait's implementors, they won't show anything about the implementation other than any bounds on the generics. You can see the full implementation details on the page for the type, but if the type is external (e.g. it's an extension trait being implemented for primitives), then you'll never be able to see the details of the implementation without opening the source code. This doesn't solve everything about that, but it does still show an incredibly useful piece of information: the associated types. This can help immensely for traits like `Deref` or `IntoIterator` in libstd, and also for traits like `IntoFuture` outside the standard library. Fixes #24200 🚨 BIKESHED ALERT 🚨 The indentation and sizing of the types is suspect. I put it in the small text so it wouldn't blend in with the next impl line. (It shares a CSS class with the where clauses, as you can see in the following image.) However, the indentation is nonstandard. I initially tried with no indentation (looked awkward and blended too well with the surrounding impls) and with 4-space indentation (too easy to confuse with where clauses), before settling on the 2-space indentation seen below. It's... okay, i guess. Open to suggestions. ![snippet of the implementors of IntoIterator, showing the associated types](https://user-images.githubusercontent.com/5217170/28697456-a4e01a12-7301-11e7-868e-2a6441d6c9e0.png)
2017-07-29Rollup merge of #43509 - QuietMisdreavus:method-src, r=GuillaumeGomezMark Simulacrum-1/+9
rustdoc: add [src] links to associated functions inside an impl block While impl blocks currently have a `[src]` link to show the source for the impl block as a whole, individual methods inside that impl block do not. This can pose a problem for structs with a lot of methods, like many in libstd. This change adds little `[src]` links to individual methods that point directly to the function in the bundled source. fixes #12932 ![methods on HashMap, showing the new src links](https://user-images.githubusercontent.com/5217170/28686066-9e7a19de-72cf-11e7-8e6b-b7d60fa33032.png)
2017-07-29print associated types in traits "implementors" sectionQuietMisdreavus-0/+7
2017-07-27add [src] links to associated functions inside an impl blockQuietMisdreavus-1/+9
2017-07-23rustdoc: make major section headers self-linksZack M. Davis-13/+36
The sidebar already has links to these h2's ids, but for convenience, the h2 itself should also be a link (retaining its present appearance). This should address most of #24484.
2017-07-09Add spacing between trait functionsGuillaume Gomez-2/+9
2017-06-23rustdoc: Fix a few issues with associated constsOliver Middleton-40/+26
* Make sure private consts are stripped. * Don't show a code block for the value if there is none. * Make sure default values are shown in impls. * Make sure docs from the trait are used if the impl has no docs.
2017-06-12Rollup merge of #42592 - ollie27:rustdoc_empty_modules, r=steveklabnikCorey Farwell-15/+4
rustdoc: Stop stripping empty modules There is no good reason to strip empty modules with no documentation and doing so causes subtle problems. Fixes #42590
2017-06-11rustdoc: Stop stripping empty modulesOliver Middleton-15/+4
There is no good reason to strip empty modules with no documentation and doing so causes subtle problems.
2017-06-09rustdoc: Use `create_dir_all` to create output directoryOliver Middleton-20/+5
Currently rustdoc will fail if passed `-o foo/doc` if the `foo` directory doesn't exist. Also remove unneeded `mkdir` as `create_dir_all` can now handle concurrent invocations.
2017-06-09Document direct implementations on type aliases.Michael Killough-2/+20
This improves #32077, but is not a complete fix. For a type alias `type NewType = AliasedType`, it will include any `impl NewType` and `impl Trait for NewType` blocks in the documentation for `NewType`. A complete fix would include the implementations from the aliased type in the type alias' documentation, so that users have a complete picture of methods that are available on the alias. However, to do this properly would require a fix for #14072, as the alias may affect the type parameters of the type alias, making the documentation difficult to understand. (That is, for `type Result = std::result::Result<(), ()>` we would ideally show documentation for `impl Result<(), ()>`, rather than generic documentation for `impl<T, E> Result<T, E>`). I think this improvement is worthwhile, as it exposes implementations which are not currently documented by rustdoc. The documentation for the implementations on the aliased type are still accessible by clicking through to the docs for that type. (Although perhaps it's now less obvious to the user that they should click-through to get there).
2017-06-02rustdoc: Hide `self: Box<Self>` in list of deref methodsOliver Middleton-7/+12
These methods can never be called through deref so there is no point including them. For example you can't call `into_boxed_bytes` or `into_string` on `String`.
2017-05-31rustdoc: Cleanup associated const value renderingOliver Middleton-2/+2
Rather than (ab)using Debug for outputting the type in plain text use the alternate format parameter which already does exactly that. This fixes type parameters for example which would output raw HTML. Also cleans up adding parens around references to trait objects.
2017-05-02Remove jquery dependencyGuillaume Gomez-2/+0
2017-04-22Re-enable hoedown by defaultGuillaume Gomez-15/+29
2017-04-17Rollup merge of #41280 - QuietMisdreavus:rustdoc-toc, r=GuillaumeGomezCorey Farwell-3/+221
rustdoc: add a list of headings to the sidebar It's another misdreavus rustdoc PR, which means it's time for Bikeshed City once again! `:3` In an effort to aid navigation in long documentation pages, this PR adds a listing of headings to the sidebars of pages where such headings exist. For example, for structs, links to their fields, inherent methods, and trait implementations are available where applicable. Examples: * Modules/Crate roots ![image](https://cloud.githubusercontent.com/assets/5217170/25019930/1000fa3a-2052-11e7-98ff-ddf5af18b3e6.png) * Enums ![image](https://cloud.githubusercontent.com/assets/5217170/25019954/33497f9e-2052-11e7-88cf-df46f1b3b8a3.png) * Primitives ![image](https://cloud.githubusercontent.com/assets/5217170/25019978/4820bbc6-2052-11e7-8b5a-96a864eb2a5b.png) * Traits ![image](https://cloud.githubusercontent.com/assets/5217170/25020093/bd1bc9f2-2052-11e7-9cd1-00a0ad8007bc.png) * Structs ![image](https://cloud.githubusercontent.com/assets/5217170/25020145/d75206b0-2052-11e7-88cc-9e9525084775.png) Open questions: * Right now, these kinds of pages (and also unions) are the only pages that will receive the name header - pages for functions, constants, macros, etc, won't have the corresponding name in their sidebar. Should I print the name regardless and only add table-of-contents links for pages that have them? This would make them match, for example, a struct with no public fields, no methods, and no trait implementations. The latter would still have a "Struct MyStruct" line above the module contents, with no header links to speak of, whereas a function wouldn't even have "Function my\_function". * This is only a header listing, but there has been requests to include a more-complete listing of fields/methods/traits/etc, for example in #41123.
2017-04-17rustdoc: add a list of headings to the sidebarQuietMisdreavus-3/+221
2017-04-09merge with master to pick up pulldown switchQuietMisdreavus-12/+63
2017-04-06rustdoc: where clause adjustment to fix testsQuietMisdreavus-2/+2
- add spaces to output so stripping lines and breaking spaces renders the same - add commas to where clauses in rustdoc tests to match the new output
2017-04-06rustdoc: Use pulldown-cmark for Markdown HTML renderingOliver Middleton-7/+5
Instead of rendering all of the HTML in rustdoc this relies on pulldown-cmark's `push_html` to do most of the work. A few iterator adapters are used to make rustdoc specific modifications to the output. This also fixes MarkdownHtml and link titles in plain_summary_line.
2017-04-04rustdoc: don't add a space before `{` on traits with where clausesQuietMisdreavus-3/+8
cc #41025
2017-04-04rustdoc: properly indent fn signatures in traitsQuietMisdreavus-23/+27
2017-03-31rustdoc: format where clauses like rust-lang-nursery/fmt-rfcs#38QuietMisdreavus-37/+25