summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2015-05-11Auto merge of #25225 - bluss:doc-search-assoc-items, r=alexcrichtonbors-1/+15
Rustdoc fixes for associated items This is related to isssue #22442 and solves it partly. This solves the search index links of associated types and constants, so that they link to the trait page. Also add an Associated Constants section if constants are present.
2015-05-09Rollup merge of #25216 - barosl:no-more-task, r=ManishearthManish Goregaokar-7/+7
I've found that there are still huge amounts of occurrences of `task`s in the documentation. This PR tries to eliminate all of them in favor of `thread`.
2015-05-09rustdoc: Add Associated Constants sectionUlrik Sverdrup-0/+11
Section only visible if there are assoc. consts. present.
2015-05-08Remove references to deprecated `extern crate "foo" as bar` syntaxCarol Nichols-1/+1
This syntax was removed in b24a3b8 but references remained in the grammar, the reference, rustdoc generation, and some auxiliary test files that don't seem to have been used since 812637e.
2015-05-09rustdoc: Link associated items in search index to traitUlrik Sverdrup-1/+4
This is related to isssue #22442 and solves it partly. This solves the links of associated types and constants, so that they link to the trait page.
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-7/+7
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-07Auto merge of #24973 - roryokane:fix-minus-doc-buttons, r=alexcrichtonbors-15/+31
My change in #24797 had a bug, described in that issue’s comments, and first discovered in issue #24918. This fixes it. I tested this new `main.js` by changing the `main.js` content of [a rendered docs page](https://doc.rust-lang.org/std/option/) to this new content. The ‘[−]’ button worked again. I am also including another related fix, because it would require manual merging if I made a separate pull request for it. The page-global ‘[−]’ button currently adds `#` to the end of the URL whenever it is clicked. I am changing its `href` from `#` to `javascript:void(0)` (the same as the `href` for section-specific ‘[−]’ links) to fix that.
2015-05-07Remove trailing whitespace on blank lineRory O’Kane-1/+1
This style inconsistency was noted at https://travis-ci.org/rust-lang/rust/builds/61583070#L371
2015-05-07Refactor doc toggle button label changingRory O’Kane-16/+31
To separate concerns, instead of checking the state of `#toggle-all-docs` by looking at its label text, I add or remove a class `will-expand` depending on whether the button’s next click will expand everything. (The `if` statement’s two branches were swapped as part of this change.) I moved the desired text values to a function `labelForToggleButton`, so changing the values will be easier. I also note in a comment the other file where the text is duplicated. To allow the labels of both types of toggle buttons to be uniformly set, I added a `span.inner` to the global button too. I split the template in `render.rs` into multiple lines to make room for the `span`, and that adds whitespace around the `[` and `]` text elements. That seems to be okay, though – the page still looks the same. I updated the CSS styling for `.collapse-toggle > .inner` to add a little extra space around the symbol, to make minus signs easier to identify. (`#toggle-all-docs > .inner` does not need the same style, since its text size is bigger, so it naturally puts more space around the symbol.)
2015-05-06Add note about type signature searching to docsAndrei Oprea-0/+4
2015-04-30rustdoc: Fix rendering associated constantsAlex Crichton-7/+24
Associated constants were now showing up for traits and would panic if they were found on an inherent impl. This commit unblocks the nighly builders.
2015-04-30Fix style warning, “line longer than 100 chars”Rory O’Kane-1/+2
Error was noted at https://travis-ci.org/rust-lang/rust/builds/60643081#L371 I didn’t just put the content of the node on another line, because that would add spaces around the element content, messing up the JavaScript that checks what the content is.
2015-04-30Change docs toggle href from # to javascript:Rory O’Kane-1/+1
So that when you click the link, the URL doesn’t get # appended to it. The non-page-global docs toggle link, which is created in `main.js`, already uses this `href` value.
2015-04-30Fix doc [−] button bug by escaping differentlyRory O’Kane-9/+9
The cause of the problem is described here: https://github.com/rust-lang/rust/pull/24797#issuecomment-97049765 . I tested this new `main.js` by changing the `main.js` content of a rendered docs page to this new content. The [−] button worked again.
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-38/+64
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-27Rollup merge of #24804 - liigo:new-trait-color, r=steveklabnikSteve Klabnik-1/+1
Fixes #24441 Preview: ![new-trait-color](https://cloud.githubusercontent.com/assets/346530/7331922/d6cbcf72-eb58-11e4-8a1d-4ca5e3683ed2.png)
2015-04-27Rollup merge of #24797 - roryokane:patch-1, r=nikomatsakisSteve Klabnik-9/+9
The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look slightly smoother. If you don’t want to use literal Unicode characters, I can change ‘−’ to `\u2212`. I’m not starting with that suggestion because ‘−’ is easier to read and understand, and if I used `\u2212`, it would probably be necessary to also comment the usage on each line to explain what character is being used.
2015-04-27Change literal minus ‘−’ to HTML entity ‘&minus;’Rory O’Kane-9/+9
So that if people accidentally delete the character, they won’t re-type it as a hyphen, which would cause bugs. I changed ‘&plus;’ too, even though it won’t be re-typed incorrectly, so that it is easier to see when plus is used as a symbol for the button, and when it is used as an operator in code. It also makes it clearer that the use of an entity for minus is on purpose, so people won’t be tempted to replace the entity incorrectly with a hyphen character.
2015-04-27Change hyphen to minus in HTML template tooRory O’Kane-1/+1
2015-04-24In [-] doc buttons, change hyphen ‘-’ to minus ‘−’Rory O’Kane-5/+5
The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look more smooth.
2015-04-25rustdoc: change color of trait typesLiigo Zhuang-1/+1
Fixes #24441
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-24Rollup merge of #24717 - liigo:add-back-toggle-links, r=alexcrichtonManish Goregaokar-3/+7
r? @alexcrichton (since you added `.stability` warning messages)
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-2/+22
constants is not yet working.
2015-04-23Structural changes for associated constantsSean Patrick Santos-38/+44
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-23rustdoc: add back [-]/[+] toggle links for unstable-methodsLiigo Zhuang-3/+7
2015-04-23rustdoc: toggle collapse/expand all docs using the same linkLiigo Zhuang-15/+20
2015-04-21implement rfc 1054: split_whitespace() fn, deprecate words()kwantam-1/+1
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
2015-04-17Remove info for path (fixup #24452)Manish Goregaokar-1/+0
2015-04-16Use BTreeMap in build_sidebar_itemsMathijs van de Nes-3/+4
This ensures that later when generating HTML, the JSON will be sorted aswell. We now have a deterministic build of sidebar-items.js
2015-04-16rustdoc: Inline methods inhereted through DerefAlex Crichton-36/+105
Whenever a type implements Deref, rustdoc will now add a section to the "methods available" sections for "Methods from Deref<Target=Foo>", listing all the inherent methods of the type `Foo`. Closes #19190
2015-04-16rustdoc: Fix cross-crate macro source linksAlex Crichton-20/+46
The source filename for cross crate macros isn't quite right so the normal generated links are invalid. Closes #21311
2015-04-16rustdoc: Overhaul stability displaysAlex Crichton-247/+116
This commit is an overhaul to how rustdoc deals with stability of the standard library. The handling has all been revisited with respect to Rust's current approach to stability in terms of implementation as well as the state of the standard library today. The high level changes made were: * Stable items now have no marker by default * Color-based small stability markers have been removed * Module listings now fade out unstable/deprecated items slightly * Trait methods have a separate background color based on stability and also list the reason that they are unstable. * `impl` blocks with stability no longer render at all. This may be re-added once the compiler recognizes stability on `impl` blocks. * `impl` blocks no longer have stability of the methods implemente indicated * The stability summary has been removed Closes #15468 Closes #21674 Closes #24201
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-23/+23
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-13/+13
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-13rustdoc: Prevent '/' from showing the help dialogBarosl Lee-3/+5
Only '?' should do that. Fixes #24289.
2015-04-07rustdoc: Index inherent methods on primitivesAlex Crichton-42/+17
The set of types which can have an inherent impl changed slightly and rustdoc just needed to catch up to understand what it means to see a `impl str`! Closes #23511
2015-04-07rustdoc: Handle tests with bare `#` marksAlex Crichton-1/+3
Strip them from output like other `# `-starting lines. Closes #23106
2015-04-07rustdoc: Encode ABI in all methodsAlex Crichton-2/+15
This commit ensures that the ABI of functions is propagated all the way through to the documentation. Closes #22038
2015-04-07rustdoc: Improve handling inlined associated typesAlex Crichton-11/+24
* All bounds are now discovered through the trait to be inlined. * The `?Sized` bound now renders correctly for inlined associated types. * All `QPath`s (`<A as B>::C`) instances are rendered as `A::C` where `C` is a hyperlink to the trait `B`. This should improve at least how the docs look at least. * Supertrait bounds are now separated and display as the source lists them. Closes #20727 Closes #21145
2015-04-07rustdoc: Show impls for references to typesAlex Crichton-1/+6
It's somewhat common to impl traits for `&T` and `&mut T` so show these on the pages for `T` to ensure they're listed somewhere at least. Closes #20175
2015-04-07rustdoc: Render methods/impls for bare traitsAlex Crichton-32/+35
This renders a "Methods" and "Trait Implementations" section for each item implemented for a bare trait itself. Closes #19055
2015-04-07rustdoc: Allowing specifying attrs for doctestsAlex Crichton-2/+4
This adds support in rustdoc to blanket apply crate attributes to all doc tests for a crate at once. The syntax for doing this is: #![doc(test(attr(...)))] Each meta item in `...` will be applied to each doctest as a crate attribute. cc #18199
2015-04-07rustdoc: Link "Trait Implementations" to sourcesAlex Crichton-105/+107
All methods listed in "Trait Implementations" now hyperlink to the source trait instead of themselves, allowing easy browsing of the documentation of a trait method. Closes #17476
2015-04-07rustdoc: Only hide possibly private modulesAlex Crichton-1/+3
If an empty public module has no documentation, it shouldn't emit a page that's just a redirect loop to itself! Closes #16265
2015-04-07rustdoc: Add a primitive page for raw pointersAlex Crichton-4/+11
Closes #15318
2015-04-07rustdoc: Run external traits through filtersAlex Crichton-14/+6
This ensures that all external traits are run through the same filters that the rest of the AST goes through, stripping hidden function as necessary. Closes #13698
2015-04-06rustdoc: Use iterators to collapse whitespaceMichael Macias-21/+8
Thanks, @alexcrichton!
2015-04-06rustdoc: Add a custom callback for codespan to collapse whitespaceMichael Macias-3/+59
Because the current style for `code` in rustdoc is to prewrap whitespace, code spans that are hard wrapped in the source documentation are prematurely wrapped when rendered in HTML. CommonMark 0.18 [[1]] specifies "interior spaces and line endings are collapsed into single spaces" for code spans, which would actually prevent this issue, but hoedown does not currently conform to the CommonMark spec. The added span-level callback attempts to adhere to how whitespace is handled as described by CommonMark, fixing the issue of early, unintentional wrapping of code spans in rendered HTML. [1]: http://spec.commonmark.org/0.18/
2015-04-05Auto merge of #24055 - estsauver:24044, r=alexcrichtonbors-0/+2
If a result is highlighted, when the search changes that state should no longer be highlighted. Fixes #24044 cc @steveklabnik