| Age | Commit message (Collapse) | Author | Lines |
|
Replace hoedown with pull in rustdoc
cc @rust-lang/docs
|
|
|
|
|
|
|
|
Fix for #39596: sort Trait2 before Trait10.
This is a change discussed in #39596. Essentially, item names will be sorted as if they're (&str, u64) pairs instead of just `&str`, meaning that `"Apple" < "Banana"` and also `"Fruit10" > "Fruit2"`.
Sample sorting:
1. Apple
2. Banana
3. Fruit
4. Fruit0
5. Fruit00
6. Fruit1
7. Fruit01
8. Fruit2
9. Fruit02
10. Fruit20
11. Fruit100
12. Pear
Examples of generated documentation:
https://docs.charr.xyz/before-doc/test_sorting/
https://docs.charr.xyz/after-doc/test_sorting/
Screenshots of generated documentation:
Before: http://imgur.com/Ktb10ti
After: http://imgur.com/CZJjqIN
|
|
|
|
|
|
Fix const not displayed in rustdoc
Fixes #40331.
r? @rust-lang/docs
|
|
`TokenStream`-based attributes, paths in attribute and derive macro invocations
This PR
- refactors `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.
- supports macro invocation paths for attribute procedural macros.
- e.g. `#[::foo::attr_macro] struct S;`, `#[cfg_attr(all(), foo::attr_macro)] struct S;`
- supports macro invocation paths for derive procedural macros.
- e.g. `#[derive(foo::Bar, super::Baz)] struct S;`
- supports arbitrary tokens as arguments to attribute procedural macros.
- e.g. `#[foo::attr_macro arbitrary + tokens] struct S;`
- supports using arbitrary tokens in "inert attributes" with derive procedural macros.
- e.g. `#[derive(Foo)] struct S(#[inert arbitrary + tokens] i32);`
where `#[proc_macro_derive(Foo, attributes(inert))]`
r? @nrc
|
|
|
|
|
|
The generates HTML can contain quotes so we need to make sure they are
escaped before inserting into the js files.
|
|
Improve associated constant rendering in rustdoc
Before:
<img width="1440" alt="screen shot 2017-02-19 at 00 30 51" src="https://cloud.githubusercontent.com/assets/3050060/23097697/caeed80e-f63a-11e6-98c2-5d27e4efd76d.png">
After:
<img width="1440" alt="screen shot 2017-02-19 at 00 30 39" src="https://cloud.githubusercontent.com/assets/3050060/23097698/cfb4874e-f63a-11e6-80cf-ffbf5c5c6162.png">
cc @SergioBenitez
r? @rust-lang/docs
|
|
|
|
|
|
|
|
|
|
rustdoc: Only include a stability span if needed.
This patch gets rid of the empty stability boxes in docs by only including the span that creates it when the item actually has a stability class.
Here are images of the issue on `std::process::Output`:
Before:
<img width="340" alt="before" src="https://cloud.githubusercontent.com/assets/122457/22853638/ff88d1b2-f010-11e6-90d6-bf3d10e2fffa.png">
After:
<img width="333" alt="after" src="https://cloud.githubusercontent.com/assets/122457/22853639/06bfe7cc-f011-11e6-9892-f0ea2cc6ec90.png">
This is my first non-trivial patch to Rust, so I'm sure some of my approach is not idiomatic. Let me know how you'd like me to adjust!
|
|
Add the item type to the tooltip
See:
https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks
|
|
rustdoc: Show attributes on all item types
Currently attributes are only shown for structs, unions and enums but
they should be shown for all items. For example it is useful to know if a
function is `#[no_mangle]`.
|
|
|
|
|
|
See:
https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks
|
|
Currently attributes are only shown for structs, unions and enums but
they should be shown for all items. For example it is useful to know if a
function is `#[no_mangle]`.
|
|
* Don't disambiguate if there are multiple impls for the same type.
* Disambiguate for impls of &Foo and &mut Foo.
* Don't try to disambiguate generic types.
|
|
|
|
|
|
|
|
rustdoc: escape the deprecated and unstable reason text
Fix #38220.
Instead of the [current output](https://doc.rust-lang.org/std/boxed/trait.FnBox.html):
<img width="967" alt="incorrect unescaped unstable reason in docs" src="https://cloud.githubusercontent.com/assets/1606434/21021898/73121d42-bd2f-11e6-8076-8a5127dbc010.png">
display:
<img width="979" alt="escaped unstable reason in docs" src="https://cloud.githubusercontent.com/assets/1606434/21021876/52eb0f88-bd2f-11e6-9088-58bdc7d92328.png">
|
|
Rustdoc: disambiguate Implementors when the type name is not unique
Presentation [goes from](https://doc.rust-lang.org/stable/std/iter/trait.ExactSizeIterator.html#implementors):
<img width="492" alt="" src="https://cloud.githubusercontent.com/assets/1606434/21276752/b2b50474-c387-11e6-96e1-9766851da269.png">
to:
<img width="787" alt="" src="https://cloud.githubusercontent.com/assets/1606434/21276763/bb37f6b0-c387-11e6-8596-9163cb254674.png">
on cases where there're multiple implementors with the same name.
Fixes #37762.
|
|
|
|
|
|
rustdoc: Fix invalid HTML in stability notices
`em` tags cannot contain `p` tags so use `div`s instead of `em`s as the Markdown will create `p` tags.
|
|
|
|
rustdoc: Fix short summaries in search results
They should be run through a Markdown renderer in rustdoc to remove
links.
This also fixes the mouse over text for the Crates list on the sidebar.
[before](https://doc.rust-lang.org/nightly/std/index.html?search=ord) [after](https://ollie27.github.io/rust_doc_test/std/index.html?search=ord)
|
|
|
|
|
|
|
|
`MarkdownHtml` structs escape HTML tags from its text.
|
|
`em` tags cannot contain `p` tags so just use a `div` instead.
|
|
|
|
They should be run through a Markdown renderer in rustdoc to remove
links.
This also fixes the mouse over text for the Crates list on the sidebar.
|
|
When an item is defined in an external macro it doesn't get a real
filename so we need to filter out these when generating src links for
reexported items.
|
|
rustdoc: Sort lines in search index and implementors js
This means the files are generated deterministically even with rustdoc running in parallel.
Fixes the first part of #30220.
|
|
This means the files are generated deterministically even with rustdoc
running in parallel.
|
|
rustdoc: get back missing crate-name when --playground-url is used
follow up PR #37763
r? @alexcrichton (since you r+ed to #37763 )
----
Edit: When `#![doc(html_playground_url="")]` is used, the current crate name is saved to `PLAYGROUND`, so rustdoc may generate `extern crate NAME;` into code snips automatically. But when `--playground-url` was introduced in PR #37763, I forgot saving crate name to `PLAYGROUND`. This PR fix that.
----
Update:
- add test
- unstable `--playground-url`
|
|
|
|
|
|
follow up PR #37763
|
|
|