summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2015-04-13rustdoc: Prevent '/' from showing the help dialogBarosl Lee-3/+5
Only '?' should do that. Fixes #24289.
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
2015-04-04Make changing doc search unhighlight current resultEarl St Sauver-0/+2
If a result is highlighted, when the search changes that state should no longer be highlighted. Fixes #24044 cc @steveklabnik
2015-04-01Fix sidebar bugCarlos Galarza-4/+6
Validate if the description is available in the rawSearchIndex
2015-03-29Fix extremely small stability bars on docs pageWesley Wiser-0/+4
Fixes #23397
2015-03-15Strip trailing whitespaceTamir Duberstein-4/+4
2015-03-15Strip all leading/trailing newlinesTamir Duberstein-1/+0
2015-03-14Auto merge of #23289 - mihneadb:rustdoc-search-by-type, r=alexcrichtonbors-2/+35
This adds search by type (for functions/methods) support to Rustdoc. Target issue is at https://github.com/rust-lang/rfcs/issues/658. I've described my approach here: https://github.com/rust-lang/rfcs/issues/658#issuecomment-76484200. I'll copy the text in here as well: --- Hi, it took me longer than I wished, but I have implemented this in a not-too-complex way that I think can be extended to support more complex features (like the ones mentioned [here](https://github.com/rust-lang/rust/issues/12866#issuecomment-66945317)). The idea is to generate a JSON representation of the types of methods/functions in the existing index, and then make the JS understand when it should look by type (and not by name). I tried to come up with a JSON representation that can be extended to support generics, bounds, ref/mut annotations and so on. Here are a few samples: Function: ```rust fn to_uppercase(c: char) -> char ``` ```json { "inputs": [ {"name": "char"} ], "output": { "name": "char", } } ``` Method (implemented or defined in trait): ```rust // in struct Vec // self is considered an argument as well fn capacity(&self) -> usize ``` ```json { "inputs": [ {"name": "vec"} ], "output": { "name": "usize" } } ``` This simple format can be extended by adding more fields, like `generic: bool`, a `bounds` mapping and so on. I have a working implementation in https://github.com/rust-lang/rust/compare/master...mihneadb:rustdoc-search-by-type. You can check out a live demo [here](http://data.mihneadb.net/doc/std/index.html?search=charext%20-%3E%20char). ![screenshot from 2015-02-28 00 54 00](https://cloud.githubusercontent.com/assets/643127/6422722/7e5374ee-bee4-11e4-99a6-9aac3c9d5068.png) The feature list is not that long: - search by types (you *can* use generics as well, as long as you use the exact name - e.g. [`vec,t -> `](http://data.mihneadb.net/doc/std/index.html?search=vec%2C%20t%20-%3E)) - order of arguments does not matter - `self` is took into account as well (e.g. search for `vec -> usize`) - does not use "complex" annotations (e.g. you don't search for `&char -> char` but for `char -> char`) My goal is to get a working, minimal "base" merged so that others can build upon it. How should I proceed? Do I open a PR (badly in need of code review since this is my first non "hello world"-ish rust code)? ---
2015-03-14Add support to search functions by type to rustdoc.Mihnea Dobrescu-Balaur-2/+35
2015-03-12Rollup merge of #22769 - :rustdocfix, r=brsonManish Goregaokar-17/+0
Fixes #22325
2015-03-09Rustdoc: Add Headline Style for `tymethod`Pascal Hertleif-2/+2
Fixes #23230
2015-03-06Rollup merge of #23082 - killercup:patch-6, r=alexcrichtonManish Goregaokar-1/+1
This should fix #22615. Previously, the playpen links grabbed the content of all `.rusttest` containers on the same level to build the URL. Now they just select the one before the `pre` they are shown in. I have only tested this by changing the file in my local build of the docs (not by running rustdoc itself).
2015-03-05Fix Playpen Links Containing Multiple ExamplesPascal Hertleif-1/+1
Fixes #22615.
2015-03-05rustdoc: Move sidebar items into shared JavaScript.Kang Seonghoon-21/+65
It had been a source of huge bloat in rustdoc outputs. Of course, we can simply disable compiler docs (as `rustc` generates over 90M of HTML) but this approach fares better even after such decision. Each directory now has `sidebar-items.js`, which immediately calls `initSidebarItems` with a JSON sidebar data. This file is shared throughout every item in the sidebar. The current item is highlighted via a separate JS snippet (`window.sidebarCurrent`). The JS file is designed to be loaded asynchronously, as the sidebar is rendered before the content and slow sidebar loading blocks the entire rendering. For the minimal accessibility without JS, links to the parent items are left in HTML. In the future, it might also be possible to integrate crates data with the same fashion: `sidebar-items.js` at the root path will do that. (Currently rustdoc skips writing JS in that case.) This has a huge impact on the size of rustdoc outputs. Originally it was 326MB uncompressed (37.7MB gzipped, 6.1MB xz compressed); it is 169MB uncompressed (11.9MB gzipped, 5.9MB xz compressed) now. The sidebar JS only takes 10MB uncompressed & 0.3MB gzipped.
2015-02-24fix rustdoc performance problemsJulian Orth-17/+0
Fixes #22325
2015-02-20Fix style fallout from 204e2bd442Simonas Kazlauskas-2/+17
Links in docblock headers also became blue, which was not intended.
2015-02-18Style all docblock links properlySimonas Kazlauskas-2/+2
Fixes #22493
2015-02-15Add styles for docblock tablesSimonas Kazlauskas-0/+21
Fixes #22357
2015-02-09Make fallback font 'serif', rather than 'sans-serif' fontsSean Collins-1/+1
2015-01-24Improve mobile-friendliness of API docsKevin Yap-1/+8
Removes min-width rule from body so that the page does not scroll horizontally on mobile displays; hides out-of-band information.
2015-01-23Auto merge of #20221 - liigo:rustdoc-sidebar-tooltips-v3, r=alexcrichtonbors-1/+12
This pull request add tooltips to most links of sidebar. The tooltips display "summary line" of items' document. Some lengthy/annoying raw markdown code are eliminated, such as links and headers. - `[Rust](http://rust-lang.org)` displays as `Rust` (no URLs) - `# header` displays as `header` (no `#`s) Some inline spans, e.g. ``` `code` ``` and ```*emphasis*```, are kept as they are, for better readable. I've make sure `&` `'` `"` `<` and `>` are properly displayed in tooltips, for example, `&'a Option<T>`. Online preview: http://liigo.com/tmp/tooltips/std/index.html @alexcrichton @steveklabnik since you have reviewed my previous ([v1](https://github.com/rust-lang/rust/pull/13014),[v2](https://github.com/rust-lang/rust/pull/16448)) PRs of this serise, which have been closed for technical reasons. Thank you.
2015-01-21rustdoc: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-5/+2
2015-01-21fix falloutLiigo Zhuang-4/+1
2015-01-21display plain summary line in javascriptLiigo Zhuang-1/+13
2015-01-21rustdoc: add tooltips to sidebarLiigo Zhuang-1/+3
2015-01-17Increase docs search box delayChris Thorn-1/+1
Increases the delay of the search box to 500ms after key up. I tried adding a three character minimum for setting the delay, but didn't find it very useful. Should close #20095
2015-01-13Fix playpen links to not all be the sameEarl St Sauver-3/+1
Fixes #20732, that all links in some modules point to the same code examples was reported. The ID's generated for documents in librustdoc are not all unique, which means the code rendered as text is not being properly selected. This change removes the unique id generation and instead changes the frontend code to grab the correct code sample by it's relative position in the dom.
2015-01-10Fix `playpen.js` errors on `pre`s without IDsPascal Hertleif-0/+1
This adds an early return to skip code blocks without IDs. Fixes #20864.
2015-01-08Fix rustdoc fallout from #20092Barosl Lee-1/+1
Due to the CSS changes done by the previous patch to make the line numbers clickable (#20092), the sidebar became unclickable. This commit reverts the changes and adopts an alternative approach.
2015-01-06Fix JS errorSteven Fackler-1/+1
ECMAScript 6 isn't really supported anywhere Closes #20681
2015-01-05rollup merge of #20092: barosl/rustdoc-line-number-clickableAlex Crichton-6/+47
While talking on IRC, someone wanted to post a link to the Rust source code, but while the lines of the rendered source code do have anchors (`<span id="[line number]">`), there is no convenient way to make links as they are not clickable. This PR makes them clickable. Also, a minor fix of the FAQ is included.
2014-12-28Use CSS whitespace rather than padding to indentDirk Gadsden-2/+4
2014-12-27Indent where clause in rustdocDirk Gadsden-0/+3
* Add <span class=‘where’> around clause * CSS rule to format the span (for #20176)
2014-12-27Make the line numbers of the source code clickableBarosl Lee-6/+47
2014-12-05rollup merge of #19515: lifthrasiir/rustdoc-wrong-dedupCorey Richardson-1/+2
Fixes #17332.
2014-12-05rollup merge of #19503: lifthrasiir/xenophobic-rustdocCorey Richardson-2/+2
This series of commits deals with broken links to the source code. It also refactors some repetitive codes from Rustdoc. The most important commit, 1cb1f00d40f000ac7633b62a603db4fcea835ca6, describes the rationale; this will fix a half of #16289. Other commits are reasonably independent to each other and can be made into indiviudal PRs at the request. ### Notes on the broken source links As of bda97e8557820cc4ec13645dbdf976e5ccaa0ce1 (I've used this to check the PR works as intended), there are 281 (!) such broken links. They can be further classified as follows: * 178 links to incorrect item types. This is the first half of #16289, and this PR fixes all of them. * 89 links to redirect pages. They are not technically "broken" but still doesn't give a source code. I have a fix for this in mind, which would make a redirect page slightly *fat*. * 14 links to incorrect `DefId` in the `gotosrc` parameter. This is #15309, and affects many `liballoc` reexports in `libstd` but *nothing else* (curiously). I'm yet to track this down; might be a metadata bug (not sure). * 0 links to the crate reexported as a different name. This is the second half of #16289, and seems not hard to fix but I'm running out of time. Prevalence of this kind of bugs calls for a full link verifier integrated into the testing process. :S
2014-12-04rustdoc: Do not deduplicate items when their parents differ.Kang Seonghoon-1/+2
Fixes #17332.
2014-12-04rustdoc: Removed Foreign{Function,Static} item types.Kang Seonghoon-2/+2
They are just (unsafe) functions and static items to most users and even compilers! The metadata doesn't distinguish them, so Rustdoc ended up producing broken links (generated `ffi.*.html`, links to `fn.*.html`). It would be best to avoid this pitfall at all.
2014-12-01rustdoc: Check for href when prepending rootPathPaul Collier-2/+2
Fixes #18354.
2014-11-24rustdoc: Render associated types on traits and implsTom Jakubowski-6/+7
2014-11-23Highlight trait methods in rustdoc’s search resultsP1start-0/+2
2014-11-14Hide interactive elements when printing rustdocCorey Ford-0/+6
Hide the search form and expand/collapse buttons, since they aren't useful when printed.
2014-11-01doc: enable OpenType kerning and ligaturesAdrien Tétar-1/+5
2014-11-01Update one corrupt webfontAdrien Tétar-0/+0
As with last time (where I marked .woff files as binary so that git does not perform newline normalization), it's unclear how it got corrupted in the first place.
2014-11-01rustdoc: stop trying to use font-variants we don't haveAdrien Tétar-3/+2
Browser-generated weights or slants is the last thing we want...
2014-10-09rustdoc: Implement constant documentationAlex Crichton-1/+3
At the same time, migrate statics to constants.
2014-09-17rollup merge of #17226 : P1start/rustdoc-colourAlex Crichton-6/+10
2014-09-17rustdoc: Correctly distinguish enums and typesP1start-1/+1
This is done by adding a new field to the `DefTy` variant of `middle::def::Def`, which also clarifies an error message in the process. Closes #16712.
2014-09-17Restore colour to rustdoc, add colour to ffi functions and methodsP1start-5/+9
2014-09-14Display the doc-block toggle on everything again.Huon Wilson-1/+1
This needs a clone otherwise each successive insertion detaches `toggle` from the previous position. Fixes #17125.