about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2014-08-06make rustdoc more responsiveAlexis Beingessner-21/+72
* move some sidebar contents to a title bar when small * inline description toggle when small * make out-of-band and in-band content share space, rather than float and clash * compress wording of out-of-band content to avoid line-wrap as much as possible
2014-08-06Rustdoc: Add padding on <code>Simon Sapin-0/+1
… to separate text from the edge of the newly added background.
2014-08-06Rustdoc: Highlight <code> elements (from Markdown `backticks`)Simon Sapin-0/+4
2014-08-02auto merge of #16169 : Gankro/rust/simple-docs, r=cmrbors-3/+90
<strike>Adds a simple/detailed toggle to api doc pages. Detailed mode is the current behaviour, simple mode hides all doccomment details leaving only signatures for quick browsing. </strike> Adds [expand all] and [collapse all] "links" to all api doc pages. All doccomments are collapsed, leaving only signatures for quick browsing. In addition, clicking on a <strike>function name</strike> function's [toggle details] link now toggles the visibility of the associated doccomment. -------- # [Live Build Here](http://cg.scs.carleton.ca/~abeinges/doc/std/vec/struct.Vec.html) This is something that's been bothering me, and I've seen some people mention in IRC before. The docs are *great* if you want a full in-depth look at an API, but *awful* if you want to scan them. This provides the ability to toggle complexity freely. Interacts perfectly well with noscript, since the static page is effectively unchanged. Collapsing is just hiding divs with css. I'm not much of a designer, so design input welcome on the actual UX for toggling. The actual javascript is *a bit* brittle to layout changes, but it always will be without adding lots of extra junk to the actual markup, which didn't seem worth it.
2014-08-02Add hide/show detail toggles to rustdocAlexis Beingessner-3/+90
All doccomments are now collapsable via a nearby [-] button Adds [collapse all] and [expand all] buttons to the top of all api pages Tweaks some layout to accomadate this
2014-08-01Fix API docs css reversing elements that it shouldn'ttinaun-1/+2
remove unneeded `pre.rust a' selector move transform into `.test-arrow` fixes #16138
2014-07-31auto merge of #15385 : jroweboy/rust/master, r=brsonbors-44/+89
This enables the docs search function to be more forgiving for spelling mistakes. The algorithm works as a dynamic programming algorithm to detect the minimum number of changes required to the search parameter string in order to match any string in the search index. If the number of changes is less then a threshold (currently defined as 3), then the search parameter will be included as it is a possible misspelling of the word. Any results returned by the algorithm are sorted by distance and are ranked lower than results that are partial or exact matches (aka the matches returned by the original search algorithm). Additionally, the increment in the for loops in this file were using one of three different ways to increment (`i += 1` `i++` and `++i`) so I just standardized it to `++i`. As an example, consider searching for the word `String` and accidentally typing in `Strnig`. The old system would return no results because it is a misspelling, but the Levenshtein distance between these two inputs is only two, which means that this will return `String` as a result. Additionally, it will return a few other results such as `strong`, and `StdRng` because these are also similar to `Strnig`. Because of the ranking system though, this change should be unobtrusive to anyone that spells the words correctly, as those are still ranked first before any Levenshtein results.
2014-07-29making raw source display betterAlexis Beingessner-0/+8
* Make the code fill up the full width of the page (no massive whitespace on the left) * Move the code down to make it not intersect the logo * Set a min-width and remove the max-width so that the code doesn't scroll internally, but instead scrolls the page, meaning horizontal scroll bars are always available * Set overflow to actually overflow, just to be sure Fixes #15891
2014-07-28rustdoc: improvements to stability dashboardAaron Turon-2/+5
* Makes dashboard width dynamic. * Colors unmarked items. * Gives overall crate percentages.
2014-07-25rustdoc: Bind keydown instead of keypress for navAlex Crichton-2/+2
Apparently keypress doesn't quite work in all browsers due to some not invoking the handler and jquery not setting the right `which` field in all circumstances. According to http://stackoverflow.com/questions/2166771 switching over to `keydown` works and it appears to do the trick. Tested in Safari, Firefox, and Chrome. Closes #15011
2014-07-10rustdoc: Add stability dashboardAaron Turon-1/+10
This commit adds a crate-level dashboard summarizing the stability levels of all items for all submodules of the crate. The information is also written as a json file, intended for consumption by pages like http://huonw.github.io/isrustfastyet/ Closes #13541
2014-07-08webfonts: check-in licensesAdrien Tétar-0/+386
2014-07-08webfonts: serve Source Code Pro locallyAdrien Tétar-0/+12
So that we have freestanding docs.
2014-07-08webfonts: proper fixAdrien Tétar-7/+7
2014-07-03Updated the licensing information for the Levenshtein distance functionJames Rowe-2/+5
2014-07-03Improved the search by including a levenshtein distance calculation which ↵James Rowe-44/+86
enables the docs search function to be more forgiving for spelling mistakes
2014-06-30rustdoc: incorporate stability index throughoutAaron Turon-9/+19
This commit hooks rustdoc into the stability index infrastructure in two ways: 1. It looks up stability levels via the index, rather than by manual attributes. 2. It adds stability level information throughout rustdoc output, rather than just at the top header. In particular, a stability color (with mouseover text) appears next to essentially every item that appears in rustdoc's HTML output. Along the way, the stability index code has been lightly refactored.
2014-06-19(doc) Properly doc hotkeys in generated docs.Zach Pomerantz-7/+7
Updated search bar to match help text. Used correct, normalized hotkeys in search. Updated shortcut menu with working shortcuts (tabs). Changed height of search help.
2014-06-13rustdoc: Larger click areas for sidebar itemsValentin Tsatskin-5/+8
* Change links to display:block for click larger targets * Remove linebreaks due to extra space * Adjust margins so that element spacing stays the same * Sidebar item hover background colour chosen from <pre> styling
2014-06-07rustdoc: More selectively remove execute linksAlex Crichton-1/+1
Closes #14723
2014-06-06rustdoc: Submit examples to play.rust-lang.orgAlex Crichton-2/+42
This grows a new option inside of rustdoc to add the ability to submit examples to an external website. If the `--markdown-playground-url` command line option or crate doc attribute `html_playground_url` is present, then examples will have a button on hover to submit the code to the playground specified. This commit enables submission of example code to play.rust-lang.org. The code submitted is that which is tested by rustdoc, not necessarily the exact code shown in the example. Closes #14654
2014-06-01rustdoc: Fix some more broken linksAlex Crichton-1/+4
2014-05-31rustdoc: Create anchor pages for primitive typesAlex Crichton-1/+2
This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]` attribute. This attribute indicates that the current module is the "owner" of the primitive type `foo`. For rustdoc, this means that the doc-comment for the module is the doc-comment for the primitive type, plus a signal to all downstream crates that hyperlinks for primitive types will be directed at the crate containing the `#[doc]` directive. Additionally, rustdoc will favor crates closest to the one being documented which "implements the primitive type". For example, documentation of libcore links to libcore for primitive types, but documentation for libstd and beyond all links to libstd for primitive types. This change involves no compiler modifications, it is purely a rustdoc change. The landing pages for the primitive types primarily serve to show a list of implemented traits for the primitive type itself. The primitive types documented includes both strings and slices in a semi-ad-hoc way, but in a way that should provide at least somewhat meaningful documentation. Closes #14474
2014-05-31rustdoc: Show all implementors of traitsAlex Crichton-8/+6
When inlining documentation across crates, primitive implementors of traits were not shown. This commit tweaks the infrastructure to treat primitive and Path-like impls the same way, displaying all implementors everywhere. cc #14462
2014-05-25rustdoc: Move inlining to its own moduleAlex Crichton-8/+4
2014-05-25rustdoc: Get [src] links working for inlined doxAlex Crichton-0/+10
These links work by hyperlinking back to the actual documentation page with a query parameter which will be recognized and then auto-click the appropriate [src] link.
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-2/+2
[breaking-change]
2014-05-21rustdoc: Show types for traits across cratesAlex Crichton-0/+22
Right now, when you look in the "Implementors" section for traits, you only see implementors within that crate. This commit modifies that section to include implementors from neighboring crates as well. For example, the Container trait currently says that it is only implemented by strings and slices, but it is in fact implemented by nearly all containers. Implementation-wise, this change generates an "implementors cache" similarly to the search index where each crate will append implementors to the files. When the page for a trait is loaded, it will load its specific cache file, rendering links for all upstream types which implement the trait.
2014-05-10rustdoc: Fix search links to enums/typedefsAlex Crichton-2/+2
When the values in html::item_type were updated, the JS definitions were accidentally not updated as well. Closes #14095
2014-05-07auto merge of #13914 : alexcrichton/rust/pile-o-rustdoc-fixes, r=brsonbors-0/+0
Lots of assorted things here and there, all the details are in the commits. Closes #11712
2014-05-03rustdoc: Fix inclusion of the new fontsAlex Crichton-0/+0
These fonts were moved into place by rust's makefiles, but rustdoc is widely used outside of rustc itself. This moves the fonts into the rustdoc binary, similarly to the other static assets, and writes them to the output location whenever rustdoc generates documentation. Closes #13593 Closes #13787
2014-05-02rustdoc: escape shown input to prevent injectionAdrien Tétar-3/+6
2014-04-30rustdoc: fix overly broad selectorsAdrien Tétar-4/+3
2014-04-29auto merge of #13776 : adrientetar/rust/rustdoc-fix, r=brsonbors-26/+33
- Closes #13591. Relevant example: http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm (Had to use `!important` to override CSS selector precedence, namely matching over parent class.) - Implement changes from #13780 feedback, namely: * Changed font-size from 18px to 15px * Reintroduced gray background for code samples * Tightened up the margins - Fix point 1 and point 4 of #13804. Samples: - [enum.FileType](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm) - [struct.CChars](http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm) - [std](http://adrientetar.legtux.org/cached/rust-docs/std.htm) - [std::io](http://adrientetar.legtux.org/cached/rust-docs/io.htm). r? @brson
2014-04-28rustdoc: #13771: Make html links inside paragraphs more readableIvan Petkov-0/+4
All links inside docblocks will have their color set to `#4e8bca` (a light blue color to contrast against the black text). This color also offers a visible contrast from the surrounding text if viewed as grayscale, making it suitable for accessability. Docblock links will also be underlined when hovered over.
2014-04-29rustdoc: Make going back in browser history work after typing a search termNoam Yorav-Raphael-5/+4
2014-04-28rustdoc: fix a few inconsistenciesAdrien Tétar-8/+9
2014-04-27rustdoc: style tweaksAdrien Tétar-14/+19
2014-04-26rustdoc: refactor and unstyle inline section headersAdrien Tétar-8/+9
2014-04-25rustdoc: bring it inlineAdrien Tétar-6/+11
2014-04-25doc,rustdoc: store webfonts locallyAdrien Tétar-5/+5
- Avoids cross-domain requests restrictions - Better availability of content - No HTML queries needed for an offline build
2014-04-25rustdoc: fixesAdrien Tétar-5/+4
2014-04-20doc: unifying with rustdocAdrien Tétar-17/+23
Conflicts: src/doc/rust.md
2014-04-16auto merge of #13485 : adrientetar/rust/newrustdoc, r=brsonbors-59/+136
- Cherry-pick from #12996 - Use Fira Sans for headlines and sidebar (Light), Heuristica for the body (Adobe Utopia derivative). Both are licensed under the SIL OFL license. - A few tweaks Two examples: [modified `std`](http://adrientetar.legtux.org/cached/rust-docs/std.htm) and [modified `std::io`](http://adrientetar.legtux.org/cached/rust-docs/io.htm). cc #13484 **Blocked on graydon/rust-www#25 (for hosting of the fonts), that's showcased [here](http://adrientetar.github.io/rust-www/).** cc @brson, @TheHydroImpulse
2014-04-15rustdoc: Better sorting criteria for searching.Kang Seonghoon-51/+52
This essentially rewrites the sorting algorithm, which relied on the implementation-defined handling of non-consistent sorting function (cf. ECMA-262 5th edition, section 15.4.4.11) and was also a bit inefficient. The new criteria expands the prior criteria while adding these ones: - The current crate is always preferred over other crates. (Closes #13178) - An item with a description is preferred over one without it, if item names match. This is a heuristic assuming that the documented item is more likely to be relevant. - An item with no literal occurrence of search query is handled correctly.
2014-04-15rustdoc: add webfonts and tweak the styles accordinglyAdrien Tétar-22/+59
2014-04-14rustdoc: Omit repeated paths in the search index.Kang Seonghoon-2/+4
Since the items roughly follow the lexical order, there are many consecutive items with the same path value which can be easily compressed. For the library and compiler docs, this commit decreases the index size by 26% and 6% before and after gzip, respectively.
2014-04-14rustdoc: Get rid of `allPaths` global variable by merging it into `searchIndex`.Kang Seonghoon-14/+30
2014-04-14rustdoc: Use an array instead of an object for the search index.Kang Seonghoon-8/+12
`buildIndex` JS function recovers them into the original object form. This greatly reduces the size of the uncompressed search index (27%), while this effect is less visible after gzipped (~5%).
2014-04-14rustdoc: Represent item types as a small number in the search index.Kang Seonghoon-5/+31
Has negligible improvements with gzip, but saves about 7% without it. This also has an effect of changing the tie-breaking order of item types.