about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
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
2014-01-17auto merge of #11598 : alexcrichton/rust/io-export, r=brsonbors-3/+1
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered) cc #11119
2014-01-17Tweak the interface of std::ioAlex Crichton-3/+1
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
2014-01-15Issue #3511 - Rationalize temporary lifetimes.Niko Matsakis-1/+2
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way.
2014-01-11rustdoc: Don't show a fields header if there are noneAlex Crichton-3/+3
2014-01-10rustdoc: Don't show private modulesAlex Crichton-4/+21
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-2/+2
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-0/+2
2014-01-01Remove `extern mod foo (name="bar")` syntax, closes #9543Florian Hahn-1/+1
2013-12-22std::vec: make the sorting closure use `Ordering` rather than just beingHuon Wilson-28/+28
(implicitly) less_eq.
2013-12-21std::vec: add a sugary .sort() method for plain Ord sorting.Huon Wilson-1/+1
This moves the custom sorting to `.sort_by`.
2013-12-20extra: remove sort in favour of the std method.Huon Wilson-8/+6
Fixes #9676.
2013-12-18rustdoc: thread through the context for renderingCorey Richardson-3/+9
This partially reverts 8b5a317.
2013-12-17auto merge of #11018 : sfackler/rust/variant-strip, r=alexcrichtonbors-1/+1
Previously, if every variant was private, it would display as a variantless enum instead of having the "some variants stripped" comment.
2013-12-17Fix rustdoc HTML renderingCorey Richardson-9/+8
By returning the items to process and storing them in a queue, we were losing the context that was setup for that item during the recursion. This is an easy fix, rather than hoisting out the state that it needs.
2013-12-16Fix rustdoc output of enums with private variantsSteven Fackler-1/+1
Previously, if every variant was private, it would display as a variantless enum instead of having the "some variants stripped" comment.
2013-12-16Fallout of rewriting std::commAlex Crichton-181/+85