Guillaume Gomez
b96fef8411
End of pulldown switch and remove completely hoedown
2017-03-28 11:38:55 -06:00
Oliver Schneider
eb447f4ef4
Fix various useless derefs and slicings
2017-03-27 08:58:00 +02:00
Corey Farwell
667e3166d8
Rollup merge of #40567 - clarcharr:rustdoc-sort, r=frewsxcv
...
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
2017-03-24 18:13:09 -05:00
Clar Charr
c09083c3d1
Fix for #39596 : sort Trait1 before Trait2.
2017-03-23 18:21:34 -04:00
Guillaume Gomez
f53172287a
Add whitespace around "=" in assoc items
2017-03-21 16:22:15 -04:00
Corey Farwell
a04c7de2cf
Rollup merge of #40564 - GuillaumeGomez:rustdoc-const, r=frewsxcv
...
Fix const not displayed in rustdoc
Fixes #40331 .
r? @rust-lang/docs
2017-03-19 10:18:15 -04:00
bors
9c15de4fd5
Auto merge of #40346 - jseyfried:path_and_tokenstream_attr, r=nrc
...
`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
2017-03-19 10:56:08 +00:00
Guillaume Gomez
9b892745ad
Fix const not displayed in rustdoc
2017-03-16 02:15:10 +01:00
Jeffrey Seyfried
68c1cc68b4
Refactor Attribute to use Path and TokenStream instead of MetaItem.
2017-03-14 04:03:43 +00:00
Oliver Middleton
19e0505dc7
rustdoc: Fix string escaping in implementors js files
...
The generates HTML can contain quotes so we need to make sure they are
escaped before inserting into the js files.
2017-03-12 05:12:27 +00:00
Corey Farwell
fda3f98746
Rollup merge of #39944 - GuillaumeGomez:associated-consts, r=frewsxcv
...
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
2017-02-28 22:55:28 -05:00
Guillaume Gomez
d06f72d062
Apply the same transformation to every types
2017-02-28 00:27:19 +01:00
Guillaume Gomez
5ac7a035af
Put the const type and value into <code>
2017-02-26 18:55:07 +01:00
Guillaume Gomez
081336e8eb
Improve associated constant rendering in rustdoc
2017-02-26 15:50:53 +01:00
Guillaume Gomez
8c8eda8ecd
Fix nightly-only experimental API display
2017-02-25 17:48:09 +01:00
Guillaume Gomez
74204a0ce7
Rollup merge of #39740 - jimmycuadra:rustdoc-empty-stability, r=aturon
...
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!
2017-02-12 19:16:31 +01:00
Guillaume Gomez
0095ec25cc
Rollup merge of #39697 - notriddle:rustdoc_tooltip, r=GuillaumeGomez
...
Add the item type to the tooltip
See:
https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks
2017-02-12 19:16:30 +01:00
Guillaume Gomez
be0e7498f0
Rollup merge of #39654 - ollie27:rustdoc_attributes, r=GuillaumeGomez
...
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]`.
2017-02-12 19:16:28 +01:00
Jimmy Cuadra
bd14c7f333
Remove extra closing span element.
2017-02-11 07:10:03 -08:00
Jimmy Cuadra
c603839d5f
rustdoc: Only include a stability span if needed.
2017-02-11 04:16:13 -08:00
Michael Howell
fce944d4e7
Add the item type to the tooltip
...
See:
https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks
2017-02-09 10:38:29 -07:00
Oliver Middleton
147d173d02
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]`.
2017-02-08 21:15:20 +00:00
Oliver Middleton
05eef36fa5
rustdoc: Improve impl disambiguation
...
* 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.
2017-02-06 18:11:01 +00:00
Trevor Spiteri
fe324cea64
rustdoc: mark ffi functions with unsafety icon
2017-01-31 00:57:52 +01:00
Guillaume Gomez
b7678808af
Fix missing blank space issue
2017-01-15 18:38:00 +01:00
Manish Goregaokar
0a1c9ae022
Improved rustdoc rendering for unstable features
2017-01-09 21:50:00 -08:00
bors
9749df52b7
Auto merge of #38244 - estebank:escape-reason-docs, r=ollie27
...
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 ">
2017-01-09 19:38:50 +00:00
bors
05f4a75eba
Auto merge of #38414 - estebank:doc-dissambiguate, r=steveklabnik
...
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 .
2017-01-04 17:11:02 +00:00
Oliver Middleton
b9038c8e9f
rustdoc: Fix broken CSS for trait items
2016-12-29 02:23:49 +00:00
Esteban Küber
e766c465d2
Merge branch 'master' into escape-reason-docs
2016-12-27 17:02:52 -08:00
bors
314c28b729
Auto merge of #38329 - ollie27:rustdoc_stab_em_div, r=steveklabnik
...
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.
2016-12-27 21:10:31 +00:00
Esteban Küber
346a442110
use same param name across methods
2016-12-22 23:20:22 -08:00
bors
a173778d1d
Auto merge of #38330 - ollie27:rustdoc_short_summaries, r=steveklabnik
...
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 )
2016-12-22 22:28:41 +00:00
bluss
bf7d7ae7fa
use &str instead of String
2016-12-21 21:27:31 -08:00
Esteban Küber
08aa825eb8
remove O(n^2) to O(n) behavior
2016-12-19 13:30:42 -08:00
Esteban Küber
2841bf3bc7
Rustdoc: disambiguate Implementors when the type name is not unique
2016-12-15 23:13:00 -08:00
Esteban Küber
778b3cb453
Add MarkdownHmtl escape struct
...
`MarkdownHtml` structs escape HTML tags from its text.
2016-12-14 16:57:45 -08:00
Oliver Middleton
e395fd12dd
rustdoc: Fix invalid HTML in stability notices
...
`em` tags cannot contain `p` tags so just use a `div` instead.
2016-12-13 20:59:58 +00:00
Esteban Küber
1ae2245a4e
rustdoc: escape the deprecated and unstable reason text
2016-12-12 15:15:45 -08:00
Oliver Middleton
4f15e1183c
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.
2016-12-12 18:39:36 +00:00
Oliver Middleton
c6c3a2763b
rustdoc: Remove broken src links from reexported items from macros
...
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.
2016-12-09 14:56:55 +00:00
bors
209308439a
Auto merge of #38105 - ollie27:rustdoc_deterministic_js, r=GuillaumeGomez
...
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 .
2016-12-07 16:32:48 +00:00
Oliver Middleton
d6ec686d37
rustdoc: Sort lines in search index and implementors js
...
This means the files are generated deterministically even with rustdoc
running in parallel.
2016-12-01 13:10:49 +00:00
bors
827eba4e70
Auto merge of #37911 - liigo:rustdoc-playground, r=alexcrichton
...
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`
2016-12-01 07:07:32 +00:00
Eduard-Mihai Burtescu
900191891f
rustdoc: link to cross-crate sources directly.
2016-11-30 04:48:56 +02:00
Liigo Zhuang
d5785a368e
rustdoc: fix up --playground-url
2016-11-30 10:33:23 +08:00
Liigo Zhuang
c1a6f17031
rustdoc: get back missing crate-name when --playground-url is used
...
follow up PR #37763
2016-11-30 10:33:22 +08:00
Eduard-Mihai Burtescu
12c5f8cb75
rustdoc: use libsyntax ast::Attribute instead of "cleaning" them.
2016-11-24 01:40:52 +02:00
Guillaume Gomez
be2544c66b
Rollup merge of #37881 - ollie27:rustdoc_stab_enum_macro, r=alexcrichton
...
rustdoc: Remove unnecessary stability versions
For some reason only on enum and macro pages, the stability version is
rendered after the summary unlike all other pages. As it is already
displayed at the top of the page for all items, this removes it for
consistency and to prevent it from overlapping the summary text.
Fixes #36093
2016-11-20 15:00:05 +01:00
Oliver Middleton
4dbc44fea1
rustdoc: Remove unnecessary stability versions
...
For some reason only on enum and macro pages, the stability version is
rendered after the summary unlike all other pages. As it is already
displayed at the top of the page for all items, this removes it for
consistency and to prevent it from overlapping the summary text.
2016-11-19 17:22:33 +00:00