summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-5/+4
This commit removes superfluous to_string calls from various places
2014-06-21rustdoc: show default type parameters in genericsTom Jakubowski-0/+5
fix #12291
2014-06-20auto merge of #15039 : huonw/rust/rustdoc-testharnesss, r=alexcrichtonbors-43/+76
```test_harness #[test] fn foo() {} ``` will now compile and run the tests, rather than just ignoring & stripping them (i.e. it is as if `--test` was passed). Also, the specific example in https://github.com/rust-lang/rust/issues/12242 was fixed (but that issue is broader than that example).
2014-06-19(doc) Properly doc hotkeys in generated docs.Zach Pomerantz-10/+10
Updated search bar to match help text. Used correct, normalized hotkeys in search. Updated shortcut menu with working shortcuts (tabs). Changed height of search help.
2014-06-19rustdoc: add the ability to run tests with --test.Huon Wilson-13/+20
This adds the `test_harness` directive that runs a code block using the test runner, to allow for `#[test]` items to be demonstrated and still tested (currently they are just stripped and not even compiled, let alone run).
2014-06-19rustdoc: refactor code block language info into a struct.Huon Wilson-42/+68
Fields have names, unlike an anonymous tuple.
2014-06-18Deprecate the bytes!() macro.Simon Sapin-2/+2
Replace its usage with byte string literals, except in `bytes!()` tests. Also add a new snapshot, to be able to use the new b"foo" syntax. The src/etc/2014-06-rewrite-bytes-macros.py script automatically rewrites `bytes!()` invocations into byte string literals. Pass it filenames as arguments to generate a diff that you can inspect, or `--apply` followed by filenames to apply the changes in place. Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
2014-06-18(doc) Change search placeholder text.Zach Pomerantz-1/+1
Update placeholder text to make keyboard shortcuts more apparent.
2014-06-17Add br##"xx"## raw byte string literals.Simon Sapin-1/+1
2014-06-17Add a b"xx" byte string literal of type &'static [u8].Simon Sapin-1/+2
2014-06-17Add a b'x' byte literal of type u8.Simon Sapin-1/+1
2014-06-17rustdoc: Remove outdated syntaxAlex Crichton-7/+4
Fixing some of rustdoc's rendering to use newer syntaxes rather than older syntaxes.
2014-06-15Register new snapshotsAlex Crichton-6/+5
2014-06-13rustdoc: Larger click areas for sidebar itemsValentin Tsatskin-6/+9
* Change links to display:block for click larger targets * Remove linebreaks due to extra space * Adjust margins so that element spacing stays the same * Sidebar item hover background colour chosen from <pre> styling
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-69/+66
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-11sync: Move underneath libstdAlex Crichton-1/+1
This commit is the final step in the libstd facade, #13851. The purpose of this commit is to move libsync underneath the standard library, behind the facade. This will allow core primitives like channels, queues, and atomics to all live in the same location. There were a few notable changes and a few breaking changes as part of this movement: * The `Vec` and `String` types are reexported at the top level of libcollections * The `unreachable!()` macro was copied to libcore * The `std::rt::thread` module was moved to librustrt, but it is still reexported at the same location. * The `std::comm` module was moved to libsync * The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`. It is now a private module with types/functions being reexported under `sync::comm`. This is a breaking change for any existing users of duplex streams. * All concurrent queues/deques were moved directly under libsync. They are also all marked with #![experimental] for now if they are public. * The `task_pool` and `future` modules no longer live in libsync, but rather live under `std::sync`. They will forever live at this location, but they may move to libsync if the `std::task` module moves as well. [breaking-change]
2014-06-10auto merge of #14764 : jbcrail/rust/fix-more-comments, r=alexcrichtonbors-5/+5
2014-06-10Fix more misspelled comments and strings.Joseph Crail-5/+5
2014-06-08Remove the dead code identified by the new lintJakub Wieczorek-0/+1
2014-06-07rustdoc: More selectively remove execute linksAlex Crichton-1/+1
Closes #14723
2014-06-06rustdoc: Submit examples to play.rust-lang.orgAlex Crichton-15/+105
This grows a new option inside of rustdoc to add the ability to submit examples to an external website. If the `--markdown-playground-url` command line option or crate doc attribute `html_playground_url` is present, then examples will have a button on hover to submit the code to the playground specified. This commit enables submission of example code to play.rust-lang.org. The code submitted is that which is tested by rustdoc, not necessarily the exact code shown in the example. Closes #14654
2014-06-06Rename Iterator::len to countAaron Turon-2/+2
This commit carries out the request from issue #14678: > The method `Iterator::len()` is surprising, as all the other uses of > `len()` do not consume the value. `len()` would make more sense to be > called `count()`, but that would collide with the current > `Iterator::count(|T| -> bool) -> unit` method. That method, however, is > a bit redundant, and can be easily replaced with > `iter.filter(|x| x < 5).count()`. > After this change, we could then define the `len()` method > on `iter::ExactSize`. Closes #14678. [breaking-change]
2014-06-06rustdoc: Inline static documentation across cratesAlex Crichton-24/+22
2014-06-06auto merge of #14667 : aochagavia/rust/pr2, r=huonwbors-2/+2
2014-06-06Change to_str().to_string() to just to_str()Adolfo Ochagavía-2/+2
2014-06-05Fallout from the libcollections movementAlex Crichton-3/+3
2014-06-04auto merge of #14592 : alexcrichton/rust/rustdoc-links, r=huonwbors-15/+32
These are a few assorted fixes for some issues I found this morning (details in the commits).
2014-06-04syntax: methodify the lexerCorey Richardson-1/+1
2014-06-03rustdoc: Put primitives in respective modulesAlex Crichton-14/+21
The logical location for the documentation of a primitive is in the module that declared it was a module for that primitive.
2014-06-02rustdoc: Deduplicate lists of implementorsAlex Crichton-0/+7
Inlining caused implementors to show up multiple times. cc #14584
2014-06-02docs: Stop using `notrust`Florian Gilcher-1/+2
Now that rustdoc understands proper language tags as the code not being Rust, we can tag everything properly. This change tags examples in other languages by their language. Plain notations are marked as `text`. Console examples are marked as `console`. Also fix markdown.rs to not highlight non-rust code.
2014-06-01rustdoc: Fix some more broken linksAlex Crichton-1/+4
2014-06-02rustdoc: make langstring parsing more robustFlorian Gilcher-4/+49
This changes the parsing of the language string in code examples so that unrecognized examples are not considered Rust code. This was, for example, the case when a code example was marked `sh` for shell code. This relieves authors of having to mark those samples as `notrust`. Also adds recognition of the positive marker `rust`. By default, unmarked examples are still considered rust. If any rust-specific tags are seen, code is considered rust unless marked as "notrust". Adds test cases for the detection logic.
2014-05-31rustdoc: Fix cross-crate links to reexported itemsAlex Crichton-27/+80
Cross crate links can target items which are not rendered in the documentation. If the item is reexported at a higher level, the destination of the link (a concatenation of the fully qualified name) may actually lead to nowhere. This fixes this problem by altering rustdoc to emit pages which redirect to the local copy of the reexported structure. cc #14515 Closes #14137
2014-05-31doc: Fix a number of broken linksAlex Crichton-8/+19
cc #14515
2014-05-31rustdoc: Create anchor pages for primitive typesAlex Crichton-63/+166
This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]` attribute. This attribute indicates that the current module is the "owner" of the primitive type `foo`. For rustdoc, this means that the doc-comment for the module is the doc-comment for the primitive type, plus a signal to all downstream crates that hyperlinks for primitive types will be directed at the crate containing the `#[doc]` directive. Additionally, rustdoc will favor crates closest to the one being documented which "implements the primitive type". For example, documentation of libcore links to libcore for primitive types, but documentation for libstd and beyond all links to libstd for primitive types. This change involves no compiler modifications, it is purely a rustdoc change. The landing pages for the primitive types primarily serve to show a list of implemented traits for the primitive type itself. The primitive types documented includes both strings and slices in a semi-ad-hoc way, but in a way that should provide at least somewhat meaningful documentation. Closes #14474
2014-05-31rustdoc: Show all implementors of traitsAlex Crichton-63/+43
When inlining documentation across crates, primitive implementors of traits were not shown. This commit tweaks the infrastructure to treat primitive and Path-like impls the same way, displaying all implementors everywhere. cc #14462
2014-05-31rustdoc: Freeze the cache ASAPAlex Crichton-6/+9
The cache is going to be used earlier in the HTML generation process, which means that it needs to get into TLS as soon as possible.
2014-05-31rustdoc: Refactor structure of html::runAlex Crichton-166/+179
Instead of one giant function, this breaks it up into several smaller functions which have explicit dependencies among one another. There are no code changes as a result of this commit.
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-4/+4
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-29auto merge of #14510 : kballard/rust/rename_strallocating_into_owned, ↵bors-1/+1
r=alexcrichton We already have into_string(), but it was implemented in terms of into_owned(). Flip it around and deprecate into_owned(). Remove a few spurious calls to .into_owned() that existed in libregex and librustdoc.
2014-05-28Replace StrAllocating.into_owned() with .into_string()Kevin Ballard-1/+1
We already have into_string(), but it was implemented in terms of into_owned(). Flip it around and deprecate into_owned(). Remove a few spurious calls to .into_owned() that existed in libregex and librustdoc.
2014-05-28std: Remove format_strbuf!()Alex Crichton-10/+10
This was only ever a transitionary macro.
2014-05-28rustdoc: cross-crate source links are one level lower.Huon Wilson-2/+2
Previously this was adding one-too-many `..`s to the path for the `gotosrc=...` links for local crates. Also, the `root_path` already ends in `/`s so a trailing / shouldn't be added after the root (some servers treat `...//...` different to `.../...` including the one running doc.rust-lang.org).
2014-05-27rustdoc: Only link to local inlined foreign itemsAlex Crichton-1/+7
This commit alters rustdoc to keep a hash set of known inlined items which is a whitelist for generating URLs to. Closes #14438
2014-05-27std: Rename strbuf operations to stringRicho Healey-43/+43
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-5/+5
2014-05-25rustdoc: Move inlining to its own moduleAlex Crichton-13/+38
2014-05-25rustdoc: Get [src] links working for inlined doxAlex Crichton-20/+61
These links work by hyperlinking back to the actual documentation page with a query parameter which will be recognized and then auto-click the appropriate [src] link.
2014-05-25rustdoc: Fix rendering of the 'static boundAlex Crichton-1/+1