| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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
|
|
|
|
|
|
This is just undoing changes from #41991 because we are not running markdown rendering twice.
|
|
Add warnings when rustdoc html rendering differs
|
|
|
|
|
|
|
|
Don't highlight # which does not start an attribute in rustdoc
Currently when we highlight some macros for rustdoc (e.g. `quote!` from https://github.com/dtolnay/quote), we get really bad syntax highlighting, because we assume that every token between a `#` character and the next `]` in the source must be an attribute.
This patch improves that highlighting behavior to instead only highlight after finding the `[` token after the `#` token.
(NOTE: I've only run this patch against https://github.com/nrc/rustdoc-highlight so if it doesn't build on travis that's why - I don't have a recent rustc build on this laptop)
I'm guessing r? @steveklabnik
|
|
|
|
|
|
Fixes #43869.
|
|
Fix include! in doc tests
By making the path relative to the current file.
Fixes #43153
[breaking-change] - if you use `include!` inside a doc test, you'll need to change the path to be relative to the current file rather than relative to the working directory.
|
|
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).
|
|
rustdoc: Don't add external impls to implementors js
Otherwise impls from not documented crates appear.
Fixes #43701
|
|
rather than a dummy name
|
|
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.
|
|
Otherwise impls from not documented crates appear.
|
|
|
|
|
|
|
|
|
|
rustdoc: Don't ICE on `use *;`
Fixes #42875
|
|
|
|
* 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.
|
|
rustdoc: Fix missing enum variant reexports
Fixes #35488
|
|
|
|
rustdoc: Link directly to associated types
Rather than just linking to the trait.
Also simplifies the logic used to decide whether to render the full
QPath.
|
|
There is no good reason to strip empty modules with no documentation and
doing so causes subtle problems.
|
|
Rather than just linking to the trait.
Also simplifies the logic used to decide whether to render the full
QPath.
|
|
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).
|
|
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`.
|
|
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.
|
|
|
|
|
|
For renamed reexports the new name should be used.
|
|
|
|
"##" at the start of a trimmed rustdoc line is now cut to "#" and then
shown. If the user wanted to show "##", they can type "###".
|
|
|
|
Fix invalid associated type rendering in rustdoc
Fixes #41036.
r? @rust-lang/docs
|
|
Fix rustdoc infinitely recursing when an external crate reexports itself
Previously, rustdoc's LibEmbargoVisitor unconditionally visited the
child modules of an external crate. If a module re-exported its parent
via `pub use super::*`, rustdoc would re-walk the parent, leading to
infinite recursion.
This commit makes LibEmbargoVisitor store already visited modules in an
FxHashSet, ensuring that each module is only walked once.
Fixes #40936
|
|
|
|
Previously, rustdoc's LibEmbargoVisitor unconditionally visited the
child modules of an external crate. If a module re-exported its parent
via 'pub use super::*', rustdoc would re-walk the parent, leading to
infinite recursion.
This commit makes LibEmbargoVisitor store already visited modules in an
FxHashSet, ensuring that each module is only walked once.
Fixes #40936
|
|
|
|
- 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
|
|
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.
|
|
|
|
Add support for image, rules and footnotes
Part of #40912.
r? @rust-lang/docs
PS: the footnotes are waiting for https://github.com/google/pulldown-cmark/pull/21 to be merged to be fully working.
|
|
|