summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
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.
2014-03-07rename ast::ViewItemExternMod to ast::ViewItemExternCrate, and ↵Liigo Zhuang-3/+3
clean::ExternMod to clean::ExternCrate
2014-03-06rustc: Move to FNV hashing for node/def idsAlex Crichton-2/+3
This leverages the new hashing framework and hashmap implementation to provide a much speedier hashing algorithm for node ids and def ids. The hash algorithm used is currentl FNV hashing, but it's quite easy to swap out. I originally implemented hashing as the identity function, but this actually ended up in slowing down rustc compiling libstd from 8s to 13s. I would suspect that this is a result of a large number of collisions. With FNV hashing, we get these timings (compiling with --no-trans, in seconds): | | before | after | |-----------|---------:|--------:| | libstd | 8.324 | 6.703 | | stdtest | 47.674 | 46.857 | | libsyntax | 9.918 | 8.400 |
2014-03-05rustdoc: Add anchors to section headersAlex Crichton-18/+22
This commit adds a appear-on-over link to all section headers to generated documentation. Each header also receives an id now, even those generated through markdown. The purpose of this is to provide easy to link to sections. This modifies the default header markdown generation because the default id added looks like "toc_NN" which is difficult to reconcile among all sections (by default each section gets a "toc_0" id), and it's also not very descriptive of where you're going. This chooses to adopt the github-style anchors by taking the contents of the title and hyphen-separating them (after lower casing). Closes #12681
2014-03-02rustdoc: syntax highlight macro definitions, colour $... substitutions.Huon Wilson-2/+2
Macro definitions are just their raw source code, and so should be highlighted where possible. Also, $ident non-terminal substitutions are special, and so are worth of a little special treatment.
2014-02-28auto merge of #12632 : fhahn/rust/issue-12507-rustdoc-std-module, r=alexcrichtonbors-1/+5
This PR for #12507 marks the top level `Module` in rustdoc as a crate and does render the header accordingly.
2014-03-01Publicise types/add #[allow(visible_private_types)] to a variety of places.Huon Wilson-1/+1
There's a lot of these types in the compiler libraries, and a few of the older or private stdlib ones. Some types are obviously meant to be public, others not so much.
2014-02-26Mark top level module as a crate in rustdoc, closes #12507Florian Hahn-1/+5
2014-02-24Move extra::json to libserializeAlex Crichton-1/+1
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-23auto merge of #12416 : alexcrichton/rust/highlight, r=huonwbors-9/+8
This adds simple syntax highlighting based off libsyntax's lexer to be sure to stay up to date with rust's grammar. Some of the highlighting is a bit ad-hoc, but it definitely seems to get the job done! This currently doesn't highlight rustdoc-rendered function signatures and structs that are emitted to each page because the colors already signify what's clickable and I think we'd have to figure out a different scheme before colorizing them. This does, however, colorize all code examples and source code. Closes #11393
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-1/+1
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-23rustdoc: Add syntax highlightingAlex Crichton-9/+8
This adds simple syntax highlighting based off libsyntax's lexer to be sure to stay up to date with rust's grammar. Some of the highlighting is a bit ad-hoc, but it definitely seems to get the job done! This currently doesn't highlight rustdoc-rendered function signatures and structs that are emitted to each page because the colors already signify what's clickable and I think we'd have to figure out a different scheme before colorizing them. This does, however, colorize all code examples and source code. Closes #11393
2014-02-20Mass rename if_ok! to try!Alex Crichton-162/+162
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-19rustdoc: Handle links to reexported itemsAlex Crichton-13/+28
When building up our path cache, we don't plaster over a path which was previously inserted if we're inserting a non-public-item thing. Closes #11678
2014-02-19rustdoc: Clickable links on methods themselvesAlex Crichton-17/+12
Useful for getting the link to a method or function. Closes #10332
2014-02-19rustdoc: Fix json output and inputAlex Crichton-1/+1
Turns out a hash map with integer keys isn't serializable to json. Closes #10115
2014-02-19rustdoc: Show macros in documentationAlex Crichton-0/+11
Any macro tagged with #[macro_export] will be showed in the documentation for that module. This also documents all the existing macros inside of std::macros. Closes #3163 cc #5605 Closes #9954
2014-02-19rustdoc: Fixup links to enum variantsAlex Crichton-1/+8
Pages aren't emitted for enum variants, so whenever we're linking to an enum variant instead link to the parent enum instead. Closes #12289
2014-02-17Improve naming of tuple getters, and add mutable tuple getterBrendan Zabarauskas-2/+2
Renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters.
2014-02-14extern mod => extern crateAlex Crichton-1/+1
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Update restrictions on rustdoc source renderingAlex Crichton-2/+4
The std macros used to be injected with a filename of "<std-macros>", but macros are now injected with a filename of "<{} macros>" where `{}` is filled in with the crate name. This updates rustdoc to understand this new system so it'll render source more frequently.
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-15/+15
This patch replaces all `crate` usage with `krate` before introducing the new keyword. This ensures that after introducing the keyword, there won't be any compilation errors. krate might not be the most expressive substitution for crate but it's a very close abbreviation for it. `module` was already used in several places already.
2014-02-07Rewrite path::Display to reduce unnecessary allocationKevin Ballard-1/+1
2014-02-08std::fmt: convert the formatting traits to a proper self.Huon Wilson-29/+28
Poly and String have polymorphic `impl`s and so require different method names.
2014-02-05rustdoc: update depsAdrien Tétar-1/+1
2014-02-05move concurrent stuff from libextra to libsyncJeremyLetang-1/+1
2014-02-03Fixing remaining warnings and errors throughoutAlex Crichton-2/+2
2014-02-03rustdoc: Remove io_error usageAlex Crichton-308/+340
2014-02-02std: rename fmt::Default to `Show`.Huon Wilson-4/+4
This is a better name with which to have a #[deriving] mode. Decision in: https://github.com/mozilla/rust/wiki/Meeting-weekly-2014-01-28
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-2/+4
2014-01-31Fix minor doc typosVirgile Andreani-2/+2
2014-01-27Demote self to an (almost) regular argument and remove the env param.Eduard Burtescu-1/+1
Fixes #10667 and closes #10259.
2014-01-21[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old ↵Simon Sapin-1/+1
from_utf8_owned() behavior
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-8/+10
2014-01-21[std::vec] Rename .last_opt() to .last(), drop the old .last() behaviorSimon Sapin-3/+3