about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
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-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-1/+1
2015-03-29Auto merge of #23809 - cmr:issue-21310, r=Manishearthbors-2/+6
This isn't really possible to test in an automatic way, since the only traits you can negative impl are `Send` and `Sync`, and the implementors page for those only exists in libstd. Closes #21310
2015-03-27rustdoc: show negative impls properly in the implementors pageCorey Richardson-2/+6
This isn't really possible to test in an automatic way, since the only traits you can negative impl are `Send` and `Sync`, and the implementors page for those only exists in libstd. Closes #21310
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-4/+4
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27default => or_insert per RFCAlexis Beingessner-3/+3
2015-03-26update everything to use Entry defaultsAlexis-9/+4
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-4/+4
Now that support has been removed, all lingering use cases are renamed.
2015-03-23rollup merge of #23633: tomjakubowski/rustdoc-array-primAlex Crichton-7/+12
Previously, impls for `[T; n]` were collected in the same place as impls for `[T]` and `&[T]`. This splits them out into their own primitive page in both core and std.
2015-03-23rollup merge of #23601: nikomatsakis/by-value-indexAlex Crichton-3/+3
This is a [breaking-change]. When indexing a generic map (hashmap, etc) using the `[]` operator, it is now necessary to borrow explicitly, so change `map[key]` to `map[&key]` (consistent with the `get` routine). However, indexing of string-valued maps with constant strings can now be written `map["abc"]`. r? @japaric cc @aturon @Gankro
2015-03-23Add generic conversion traitsAaron Turon-3/+3
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23rustdoc: Support for "array" primitiveTom Jakubowski-7/+12
Impls on `clean::Type::FixedVector` are now collected in the array primitive page instead of the slice primitive page. Also add a primitive docs for arrays to `std`.
2015-03-23Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses ofNiko Matsakis-3/+3
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about how to use `[]`.
2015-03-18[rustdoc] Fix source hyperlinks in docsIvan Petkov-5/+12
* rustdoc was doubly appending the file name to the path of where to generate the source files, meanwhile, the [src] hyperlinks were not * Added a flag to rustdoc::html::render::clean_srcpath to ignore the last path component, i.e. the file name itself to prevent the issue * This also avoids creating directories with the same name as source files, and it makes sure the link to `main.css` is correct as well. * Added regression tests to ensure the rustdoc heirarchy of rendered source files remains consistent Fixes #23192
2015-03-15Auto merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichtonbors-9/+10
Previously it would fail on a trivial case like /// Summary line /// <trailing space> /// Regular content Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line extractor interprets both lines as the same paragraph and includes both into the short summary resulting in ![screenshot from 2015-03-13 22 47 08](https://cloud.githubusercontent.com/assets/679122/6648596/7ef792b2-c9e4-11e4-9c19-704c288ec4de.png)
2015-03-14Auto merge of #23289 - mihneadb:rustdoc-search-by-type, r=alexcrichtonbors-1/+107
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-1/+107
2015-03-14Split rustdoc summary lines in a smarter waySimonas Kazlauskas-9/+10
Previously it would fail on a trivial case like /// Summary line /// <trailing space> /// Regular content Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line extractor would interpret both lines as the same paragraph and include both into the short summary.
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-22/+30
2015-03-10rustdoc: get back 'plain summary line' in sidebarLiigo Zhuang-3/+4
this feature was broken by mistake some days ago: @2b11a80
2015-03-07rustdoc: Fixed an asynchronous loading of rustdoc sidebars.Kang Seonghoon-1/+1
We require the *deferred* loading, not just an opportunistic asynchronous loading. I think `<script defer>` is safe to use, according to <http://caniuse.com/#feat=script-defer>.
2015-03-06rollup merge of #22975: alexcrichton/stabilize-ffiAlex Crichton-2/+1
Conflicts: src/librustc_trans/back/link.rs src/librustc_trans/lib.rs
2015-03-06BufferedWriter -> BufWriter (fixup #23060)Manish Goregaokar-1/+1
2015-03-06Rollup merge of #23060 - lifthrasiir:rustdoc-sidebar-in-js, r=alexcrichtonManish Goregaokar-51/+41
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-03-05std: Stabilize the `ffi` moduleAlex Crichton-2/+1
The two main sub-modules, `c_str` and `os_str`, have now had some time to bake in the standard library. This commits performs a sweep over the modules adding various stability tags. The following APIs are now marked `#[stable]` * `OsString` * `OsStr` * `OsString::from_string` * `OsString::from_str` * `OsString::new` * `OsString::into_string` * `OsString::push` (renamed from `push_os_str`, added an `AsOsStr` bound) * various trait implementations for `OsString` * `OsStr::from_str` * `OsStr::to_str` * `OsStr::to_string_lossy` * `OsStr::to_os_string` * various trait implementations for `OsStr` * `CString` * `CStr` * `NulError` * `CString::new` - this API's implementation may change as a result of rust-lang/rfcs#912 but the usage of `CString::new(thing)` looks like it is unlikely to change. Additionally, the `IntoBytes` bound is also likely to change but the set of implementors for the trait will not change (despite the trait perhaps being renamed). * `CString::from_vec_unchecked` * `CString::as_bytes` * `CString::as_bytes_with_nul` * `NulError::nul_position` * `NulError::into_vec` * `CStr::from_ptr` * `CStr::as_ptr` * `CStr::to_bytes` * `CStr::to_bytes_with_nul` * various trait implementations for `CStr` The following APIs remain `#[unstable]` * `OsStr*Ext` traits remain unstable as the organization of `os::platform` is uncertain still and the traits may change location. * `AsOsStr` remains unstable as generic conversion traits are likely to be rethought soon. The following APIs were deprecated * `OsString::push_os_str` is now called `push` and takes `T: AsOsStr` instead (a superset of the previous functionality).
2015-03-05rustdoc: Reworded comments to give the rationale for JS.Kang Seonghoon-1/+8
2015-03-05rustdoc: Move sidebar items into shared JavaScript.Kang Seonghoon-51/+34
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-03-04std: Deprecate std::old_io::fsAlex Crichton-56/+61
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-02-20Addressed PR commentsMarvin Löbel-1/+1
2015-02-18Fix inconsistent spacing of collapse all buttonSimonas Kazlauskas-2/+1
2015-02-13rustdoc: Show must_use attributeSeo Sanghyeon-1/+19
2015-02-06rustdoc: Show non-Rust ABIs on methodsTom Jakubowski-6/+14
Fix #21621
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-68/+64
2015-02-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-1/+1
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter_mut()` -> `for x in &mut xs`Jorge Aparicio-1/+1
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-33/+33
2015-01-30Test fixes and rebase conflictsAlex Crichton-1/+1
Also some tidying up of a bunch of crate attributes
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-1/+1
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-1/+1
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-27cleanup: s/`v.slice*()`/`&v[a..b]`/g + remove redundant `as_slice()` callsJorge Aparicio-5/+3
2015-01-26std: Rename Writer::write to Writer::write_allAlex Crichton-1/+1
In preparation for upcoming changes to the `Writer` trait (soon to be called `Write`) this commit renames the current `write` method to `write_all` to match the semantics of the upcoming `write_all` method. The `write` method will be repurposed to return a `usize` indicating how much data was written which differs from the current `write` semantics. In order to head off as much unintended breakage as possible, the method is being deprecated now in favor of a new name. [breaking-change]
2015-01-26Fallout of io => old_ioAlex Crichton-16/+16
2015-01-23Auto merge of #20221 - liigo:rustdoc-sidebar-tooltips-v3, r=alexcrichtonbors-10/+21
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-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-52/+36
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-2/+2
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-4/+4
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21396: japaric/no-parens-in-rangeAlex Crichton-6/+6
Conflicts: src/libsyntax/parse/lexer/comments.rs
2015-01-21Fallout from stabilization.Aaron Turon-2/+2
2015-01-21rustdoc: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-52/+36
2015-01-21address review comments: reuse Escape etc.Liigo Zhuang-16/+2