about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2014-05-12rustdoc: List macros in the sidebarSeo Sanghyeon-0/+1
2014-05-12librustdoc: Remove all `~str` usage from librustdoc.Patrick Walton-59/+79
2014-05-10auto merge of #14068 : alexcrichton/rust/rustdoc-xcrate-links, r=brsonbors-26/+62
This should improve the libcore experience quite a bit when looking at the libstd documentation.
2014-05-09rustdoc: Hyperlink cross-crate reexportsAlex Crichton-26/+62
This should improve the libcore experience quite a bit when looking at the libstd documentation.
2014-05-08Handle breakage after libcore splitKevin Ballard-1/+2
API Changes: - &[T] and ~[T] no longer support the addition operator (+)
2014-05-07std: Modernize the local_data apiAlex Crichton-82/+72
This commit brings the local_data api up to modern rust standards with a few key improvements: * The `pop` and `set` methods have been combined into one method, `replace` * The `get_mut` method has been removed. All interior mutability should be done through `RefCell`. * All functionality is now exposed as a method on the keys themselves. Instead of importing std::local_data, you now use "key.replace()" and "key.get()". * All closures have been removed in favor of RAII functionality. This means that get() and get_mut() no long require closures, but rather return Option<SmartPointer> where the smart pointer takes care of relinquishing the borrow and also implements the necessary Deref traits * The modify() function was removed to cut the local_data interface down to its bare essentials (similarly to how RefCell removed set/get). [breaking-change]
2014-05-03rustdoc: Turn the noise down on implemented traitsAlex Crichton-37/+7
This commit removes the inherited documentation from type pages. This generally just clutters up the page when you can click through to the trait itself to get all the meaty documentation. Closes #11991
2014-05-03rustdoc: Make static initalizers prettierAlex Crichton-24/+29
Previously, if an initializer took multiple lines or was just large in general, it was pretty poorly rendered [1] [2]. This alters the logic to just link back to the source for any multi-line static, with a placeholder of "[definition]". This should make reading statics a little easier on the eyes. All single-line statics are still inlined in the documentation. Closes #13198 [1] - http://static.rust-lang.org/doc/master/sync/mutex/index.html#statics [2] - http://static.rust-lang.org/doc/master/std/sync/atomics/index.html#statics
2014-05-03rustdoc: Fix inclusion of the new fontsAlex Crichton-6/+16
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-04-29auto merge of #13776 : adrientetar/rust/rustdoc-fix, r=brsonbors-1/+1
- 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-26auto merge of #13777 : lifthrasiir/rust/no-multi-viewitemuse, r=alexcrichtonbors-6/+4
It reflected the obsolete syntax `use a, b, c;` and did not make past the parser (though it was a non-fatal error so we can continue). This legacy affected many portions of rustc and rustdoc as well, so this PR cleans them up altogether. As a side effect of cleanup, we now have `SCHEMA_VERSION` in `rustdoc::clean` (instead of the crate root), so it has a better chance to be updated when `rustdoc::clean` gets updated.
2014-04-26syntax: ViewItemUse no longer contains multiple view paths.Kang Seonghoon-6/+4
it reflected the obsolete syntax `use a, b, c;` and did not make past the parser (though it was a non-fatal error so we can continue). this legacy affected many portions of rustc and rustdoc as well, so this commit cleans them up altogether.
2014-04-26rustdoc: refactor and unstyle inline section headersAdrien Tétar-1/+1
2014-04-25rustdoc: bring it inlineAdrien Tétar-13/+15
2014-04-21auto merge of #13587 : adrientetar/rust/more-docs, r=brsonbors-1/+1
- Use Fira Sans for headlines, Heuristica for the body (Adobe Utopia derivative). Both are licensed under the SIL OFL license. (I didn't include BoldItalic because it is sparingly used.) - Split TOC into 2 columns for the docs except manual (too tall, too wide to be readable). - Some fixes to rustdoc, bring styles in coherency with eachother - A few tweaks Two examples: [modified tutorial](http://adrientetar.legtux.org/cached/rust-docs/tutorial.htm) and [modified manual](http://adrientetar.legtux.org/cached/rust-docs/manual.htm). Rustdoc got some fixes, here is [modified `enum.FileType`](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm), [modified `std`](http://adrientetar.legtux.org/cached/rust-docs/std.htm) and [modified `std::io`](http://adrientetar.legtux.org/cached/rust-docs/io.htm). #13484, #13485 follow-up. cc @brson
2014-04-20rustdoc: Display tuple structs correctlyAlex Crichton-12/+32
The fields of tuple structs recently gained the ability to have privacy associated with them, but rustdoc was not updated accodingly. This moves the struct field filtering to the rendering phase in order to preserve the ordering of struct fields to allow tuple structs to have their private fields printed as underscores. Closes #13594
2014-04-20doc: unifying with rustdocAdrien Tétar-1/+1
Conflicts: src/doc/rust.md
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-3/+3
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-2/+1
2014-04-16auto merge of #13485 : adrientetar/rust/newrustdoc, r=brsonbors-22/+23
- 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: add webfonts and tweak the styles accordinglyAdrien Tétar-22/+23
2014-04-14rustdoc: Omit repeated paths in the search index.Kang Seonghoon-1/+15
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-5/+4
2014-04-14rustdoc: Use an array instead of an object for the search index.Kang Seonghoon-4/+4
`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-36/+19
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.
2014-04-14rustdoc: Use smaller sequential numbers instead of `NodeId`s for parents.Kang Seonghoon-13/+22
`allPaths` is now a flat array in effect. This decreases the size of the search index by about 4--5% (gzipped or not).
2014-04-10auto merge of #13440 : huonw/rust/strbuf, r=alexcrichtonbors-17/+22
libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and port all code over to use it. Rebased & tests-fixed version of https://github.com/mozilla/rust/pull/13269
2014-04-10Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and ↵Kasey Carrothers-7/+7
updated associated variable and function names.
2014-04-10rustdoc: Prune the paths that do not appear in the index.Kang Seonghoon-2/+15
For the full library and compiler docs, the size of `search-index.js` decreases by 13% (18.5% after gzip -9) which is a substantial gain.
2014-04-10Remove some internal ~[] from several libraries.Huon Wilson-4/+4
Some straggling instances of `~[]` across a few different libs. Also, remove some public ones from workcache.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-17/+22
port all code over to use it.
2014-04-06De-~[] Mem{Reader,Writer}Steven Fackler-1/+1
2014-04-06De-~[] Reader and WriterSteven Fackler-1/+1
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-03-31rustdoc: Switch field privacy as necessaryAlex Crichton-18/+18
2014-03-25auto merge of #12961 : cmr/rust/rustdoc-impls, r=alexcrichtonbors-2/+16
Rendered form available at http://docs.octayn.net/doc/ This moves derived impls to the bottom of the list, separate from the rest, and collapses default methods that aren't overridden into an expandible accordion.
2014-03-25rustdoc: render derived impls separatelyCorey Richardson-2/+16
2014-03-24test: Update all tests with the sync changesAlex Crichton-4/+4
2014-03-23iter: remove `to_owned_vec`Daniel Micay-4/+4
This needs to be removed as part of removing `~[T]`. Partial type hints are now allowed, and will remove the need to add a version of this method for `Vec<T>`. For now, this involves a few workarounds for partial type hints not completely working.
2014-03-22doc: Remove Freeze / NoFreeze from docsFlavio Percoco-2/+2
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-27/+39
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-2/+2
Closes #12702
2014-03-18rustdoc: Implement cross-crate searchingAlex Crichton-29/+56
A major discoverability issue with rustdoc is that all crates have their documentation built in isolation, so it's difficult when looking at the documentation for libstd to learn that there's a libcollections crate with a HashMap in it. This commit moves rustdoc a little closer to improving the multiple crate experience. This unifies all search indexes for all crates into one file so all pages share the same search index. This allows searching to work across crates in the same documentation directory (as the standard distribution is currently built). This strategy involves updating a shared file amongst many rustdoc processes, so I implemented a simple file locking API for handling synchronization for updates to the shared files. cc #12554
2014-03-18libsyntax: librustdoc: ignore utf-8 BOM in .rs filesLiigo Zhuang-1/+8
Closes #12974
2014-03-12auto merge of #12756 : pongad/rust/remove_owned_str_pat, r=alexcrichtonbors-6/+6
match-drop-strs-issue-4541.rs deleted as it's the same with issue-4541.rs
2014-03-12rustc: Remove matching on ~str from the languageMichael Darakananda-6/+6
The `~str` type is not long for this world as it will be superseded by the soon-to-come DST changes for the language. The new type will be `~Str`, and matching over the allocation will no longer be supported. Matching on `&str` will continue to work, in both a pre and post DST world.
2014-03-12rustdoc: whitelist the headers that get a § on hover.Huon Wilson-1/+3
Previously the :hover rules were making the links to the traits/types in something like impl<K: Hash + Eq, V> ... { ... } be displayed with a trailing `§` when hovered over. This commit restricts that behaviour to specific headers, i.e. those that are known to be section headers (like those rendered in markdown doc-comments, and the "Modules", "Functions" etc. headings).
2014-03-09rustdoc: hardcode each header as a link.Huon Wilson-1/+2
This avoids having to include JS in the guide/tutorial/manual pages just to get the headers being links. The on-hover behaviour showing the little section marker § is preserved, because that gives a useful hint that the heading is a link.
2014-03-08Index cross-mod type definition and implementation properly in rustdocEdward Wang-10/+51
A structure's definition and implementation may be cross-module. If the implementing module is parsed before defining module, the fully qualified name of the structure won't be present for the implementation to use when being indexed. So caches such 'orphan' implementation and indexes it at the end of crate parsing. Closes #10284.