1025 Commits

Author SHA1 Message Date
Steve Klabnik
2581aace9c Rollup merge of #31054 - steveklabnik:a11y, r=alexcrichton
I've been interested in the accessibility of Rustdoc's output, but never did anything about it. Today, I ran a tool, and it suggested adjusting some colors.

Here's some screen shots. Before:
![2016-01-20-114944_443x199_scrot](https://cloud.githubusercontent.com/assets/27786/12455979/d84d7ae8-bf6b-11e5-9aea-0602fb1a8cfa.png)

After:

![2016-01-20-114516_453x204_scrot](https://cloud.githubusercontent.com/assets/27786/12455841/36a55d14-bf6b-11e5-8014-239594c12e46.png)

As you can see, the link text is just a _shade_ darker.

Browsable: http://www.steveklabnik.com/rust-a11y-doc-testing/doc/std/
2016-01-23 09:38:42 -05:00
Manish Goregaokar
5a26a52a54 Handle generics in raw pointers 2016-01-23 15:32:10 +05:30
Manish Goregaokar
9a80bc8530 Correctly output links for primitive types which enclose their contents 2016-01-22 23:15:47 +05:30
Steve Klabnik
c449f04a05 tweak trait css 2016-01-20 12:34:07 -05:00
Steve Klabnik
257a1ec6f2 tweak struct colors 2016-01-20 12:26:33 -05:00
Steve Klabnik
5763b86792 Add alt tags for logos 2016-01-20 11:53:20 -05:00
Steve Klabnik
6271ee98f0 tweak colors for a11y 2016-01-20 11:47:49 -05:00
Alex Crichton
9a4f43b9b6 std: Stabilize APIs for the 1.7 release
This commit stabilizes and deprecates the FCP (final comment period) APIs for
the upcoming 1.7 beta release. The specific APIs which changed were:

Stabilized

* `Path::strip_prefix` (renamed from `relative_from`)
* `path::StripPrefixError` (new error type returned from `strip_prefix`)
* `Ipv4Addr::is_loopback`
* `Ipv4Addr::is_private`
* `Ipv4Addr::is_link_local`
* `Ipv4Addr::is_multicast`
* `Ipv4Addr::is_broadcast`
* `Ipv4Addr::is_documentation`
* `Ipv6Addr::is_unspecified`
* `Ipv6Addr::is_loopback`
* `Ipv6Addr::is_unique_local`
* `Ipv6Addr::is_multicast`
* `Vec::as_slice`
* `Vec::as_mut_slice`
* `String::as_str`
* `String::as_mut_str`
* `<[T]>::clone_from_slice` - the `usize` return value is removed
* `<[T]>::sort_by_key`
* `i32::checked_rem` (and other signed types)
* `i32::checked_neg` (and other signed types)
* `i32::checked_shl` (and other signed types)
* `i32::checked_shr` (and other signed types)
* `i32::saturating_mul` (and other signed types)
* `i32::overflowing_add` (and other signed types)
* `i32::overflowing_sub` (and other signed types)
* `i32::overflowing_mul` (and other signed types)
* `i32::overflowing_div` (and other signed types)
* `i32::overflowing_rem` (and other signed types)
* `i32::overflowing_neg` (and other signed types)
* `i32::overflowing_shl` (and other signed types)
* `i32::overflowing_shr` (and other signed types)
* `u32::checked_rem` (and other unsigned types)
* `u32::checked_neg` (and other unsigned types)
* `u32::checked_shl` (and other unsigned types)
* `u32::saturating_mul` (and other unsigned types)
* `u32::overflowing_add` (and other unsigned types)
* `u32::overflowing_sub` (and other unsigned types)
* `u32::overflowing_mul` (and other unsigned types)
* `u32::overflowing_div` (and other unsigned types)
* `u32::overflowing_rem` (and other unsigned types)
* `u32::overflowing_neg` (and other unsigned types)
* `u32::overflowing_shl` (and other unsigned types)
* `u32::overflowing_shr` (and other unsigned types)
* `ffi::IntoStringError`
* `CString::into_string`
* `CString::into_bytes`
* `CString::into_bytes_with_nul`
* `From<CString> for Vec<u8>`
* `From<CString> for Vec<u8>`
* `IntoStringError::into_cstring`
* `IntoStringError::utf8_error`
* `Error for IntoStringError`

Deprecated

* `Path::relative_from` - renamed to `strip_prefix`
* `Path::prefix` - use `components().next()` instead
* `os::unix::fs` constants - moved to the `libc` crate
* `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize
* `IntoCow` - conflicts with `Into` and may come back later
* `i32::{BITS, BYTES}` (and other integers) - not pulling their weight
* `DebugTuple::formatter` - will be removed
* `sync::Semaphore` - not used enough and confused with system semaphores

Closes #23284
cc #27709 (still lots more methods though)
Closes #27712
Closes #27722
Closes #27728
Closes #27735
Closes #27729
Closes #27755
Closes #27782
Closes #27798
2016-01-16 11:03:10 -08:00
Shmuale Mark
30779d455d rustdoc: remove dead link from issue-less unstable entries. 2016-01-11 14:38:40 -05:00
Wesley Wiser
4dee31c119 Rustdoc - Specify max-image size
Fixes #24861
2016-01-02 21:38:36 -05:00
mitaa
05780ace49 Don't record the root module in the search index 2015-12-22 19:10:08 +01:00
Vadim Petrochenkov
67a978411a Support #[deprecated] in rustdoc 2015-12-12 23:01:27 +03:00
bors
461c46052b Auto merge of #30036 - mitaa:doc_id, r=alexcrichton
This expands the code which generates unique IDs for Markdown headers within a single block to each rendered page.

fixes #25001
fixes #29449
2015-12-08 20:15:53 +00:00
mitaa
fb7008c0a0 Add tests 2015-12-05 23:11:07 +01:00
Guillaume Gomez
91cd93d2b1 Split rustdoc css to modify it more easily 2015-12-04 01:54:59 +01:00
mitaa
72d5675fef Address review comments 2015-12-04 00:48:59 +01:00
mitaa
5c01cf485f Initialize the ID map with known values 2015-12-03 02:19:23 +01:00
mitaa
fa0269dd35 Generate unique IDs for each rustdoc HTML page 2015-12-03 00:07:59 +01:00
mitaa
538689ddc7 Move ID generator to a more suited location 2015-12-03 00:07:59 +01:00
Ariel Ben-Yehuda
52dd2b4c35 fix tests & rustdoc 2015-11-26 18:22:40 +02:00
bors
6a6b97cf02 Auto merge of #29822 - petrochenkov:pubexport, r=alexcrichton
This patch implements the plan described in https://internals.rust-lang.org/t/privacy-and-its-interaction-with-docs-lints-and-stability/2880 with one deviation.

It turns out, that rustdoc needs the "directly public" set for its docs inlining logic, so the privacy pass have to produce three sets and not two. Three is arguably too many, so I merged them in one map:
`public_items/exported_items/reachable_items: NodeSet => access_levels: NodeMap<AccessLevel>`

r? @alexcrichton
2015-11-20 18:13:10 +00:00
mitaa
81b4c1342a Fix rustdocs unsafe const fn ordering 2015-11-19 22:01:49 +01:00
Vadim Petrochenkov
c1ad5af4a6 Changes to data produced by privacy pass 2015-11-19 14:16:35 +03:00
Joshua Holmer
51c35dbd30 Fix unpredictable ordering of sidebar boxes in rustdoc
A race condition in Javascript was causing unpredictable ordering
of the sidebar boxes when loading documentation generated by
rustdoc, due to the script that adds the Crates box being executed
asynchronously. Disabling the asynchronous execution and deferring
this script should ensure that the Crates box always appears last
in the sidebox (this seemed to be the more common ordering prior
to this change).

Fixes #29698
2015-11-18 16:21:19 -05:00
Ivan Kozik
3b2a8e1259 librustdoc: don't override ctrl-s and other browser shortcuts 2015-11-05 10:39:02 +00:00
mdinger
11c7bdd160 Add colors for rustdoc primitives, type, and macros links 2015-10-23 21:59:48 -04:00
mdinger
b1e3baa5b4 Merge same colors together 2015-10-23 21:07:09 -04:00
bors
5692e16270 Auto merge of #28963 - mdinger:arrow, r=steveklabnik
This is to make the link more prominent so hopefully people will actually see it. The new icon is partially because I wasn't sure how easy it would be to apply the previous transformations only to the last character of the string. As it is, I wasn't sure at first but I think the look is growing on me.

A minor nitpick is that the space after `Runnable` is underlined and I tried to fix that but it wasn't working for me right now. I tried switching a link with subelements to a div with subelements but I missed something because it wasn't working correctly.

---
Unselected:

![arrow](https://cloud.githubusercontent.com/assets/4156987/10414475/b1730ab2-6fa4-11e5-9062-15bc0c7c8b96.png)

---

Selected:

![arrow_selected](https://cloud.githubusercontent.com/assets/4156987/10414483/4a78088e-6fa5-11e5-864e-c83f354769b1.png)

Fixes https://github.com/rust-lang/rust/issues/28958
2015-10-22 00:41:21 +00:00
bors
20a6938c08 Auto merge of #28683 - GuillaumeGomez:rustdoc_error, r=alexcrichton
This PR solves the following issues (or at least help users to understand the problem):

```Rust
#![crate_name = "b"]
#![crate_type = "rlib"]

pub fn his_function_has_a_very_long_name_and_should_make_cargo_doc_explodes_because_it_will_want_to_make_a_filename_with_it_in_excess_of_the_max_filename_length_for_most_filesystem_this_is_not_yet_long_enough_i_need_moreis_function_has_a_very_long_name_and_should_make_cargo_doc_explodes_because_it_will_want_to_make_a_filename_with_it_in_excess_of_the_max_filename_length_for_most_filesystem_this_is_not_yet_long_enough_i_need_more_() {}
```

```Rust
#![crate_name = "b"]
#![crate_type = "rlib"]

pub struct his_function_has_a_very_long_name_and_should_make_cargo_doc_explodes_because_it_will_want_to_make_a_filename_with_it_in_excess_of_the_max_filename_length_for_most_filesystem_this_is_not_yet_long_enough_i_need_moreis_function_has_a_very_long_name_and_should_make_cargo_doc_explodes_because_it_will_want_to_make_a_filename_with_it_in_excess_of_the_max_filename_length_for_most_filesystem_this_is_not_yet_long_enough_i_need_more_;
```

For the maximum filename length chosen, @gkoz gave me [this link](http://unix.stackexchange.com/a/32834).
2015-10-16 23:28:14 +00:00
Guillaume Gomez
42c01d740b Improve error handling by providing Error struct with Path information 2015-10-17 00:20:00 +02:00
mdinger
dd342b05cb Make the rustdoc example links more noticable 2015-10-14 15:05:21 -04:00
Vadim Petrochenkov
ab671552c3 Refactor attr::Stability
Stricter checking + enforcement of invariants at compile time
2015-10-13 06:01:31 +03:00
Cristi Cobzarenco
4b308b44e1 typos: fix a grabbag of typos all over the place 2015-10-08 19:49:31 +01:00
bors
11a612795a Auto merge of #28573 - ruud-v-a:rustdoc-license, r=brson
The output of rustdoc includes resources licensed under the SIL Open
Font License, the MIT license, and the Apache License 2.0. All of these
licenses permit redistribution provided that the license text is also
redistributed. Previously this was not the case, making rustdoc output
unsuitable for distribution by default. This resolves that problem by
including the license texts in rustdoc output.

See also: https://users.rust-lang.org/t/licensing-rustdoc-output/2880
2015-10-04 23:30:40 +00:00
Simonas Kazlauskas
f38bc2c457 Fix librustdoc search events
Previously only keyup event was looked at, which meant that pasting, cutting and
otherwise changing the input without typing would not catch any updates to the
search query.
2015-10-02 17:02:02 +03:00
Simonas Kazlauskas
98841d4e93 Fix misnamed variable in rustdoc 2015-10-02 16:54:58 +03:00
bors
5180a7ccc5 Auto merge of #28795 - marti1125:28696, r=alexcrichton
-Add a validation when input search is empty on top of 'startSearch()'
2015-10-02 11:04:13 +00:00
Willy Aguirre
777518d844 fixes #28696 Return to the default content when .search-input is empty -Add a validation when input search is empty on top of 'startSearch()' 2015-10-01 13:30:35 -05:00
Niko Matsakis
01f32ace03 Convert DefId to use DefIndex, which is an index into a list of
paths, and construct paths for all definitions. Also, stop rewriting
DefIds for closures, and instead just load the closure data from
the original def-id, which may be in another crate.
2015-10-01 10:43:07 -04:00
Niko Matsakis
5600c6282e move direct accesses of node to go through as_local_node_id, unless
they are being used as an opaque "position identifier"
2015-10-01 10:37:19 -04:00
Niko Matsakis
9ff4f57cd0 move job of creating local-def-ids to ast-map (with a few stragglers) 2015-10-01 10:28:28 -04:00
Niko Matsakis
dc4a4ada58 move LOCAL_CRATE to cstore 2015-10-01 09:44:28 -04:00
Manish Goregaokar
9256947051 rustdoc: Remove crate name from primitives, make them turn up first in search 2015-09-27 14:48:36 +05:30
Nick Howell
115ec662b5 Add 'use strict' to playpen.js 2015-09-24 22:35:04 -04:00
Ruud van Asseldonk
6c566524b6 Clarify rustdoc output licensing with a copyright file 2015-09-21 22:40:27 +01:00
Simon Mazur
09c1ce18a2 rustdoc: added tests for header rendering & minor fixes 2015-09-20 13:24:47 +03:00
Simon Mazur
d6f0a21e20 rustdoc: remove redundant test 2015-09-20 13:24:47 +03:00
Simon Mazur
d539f451c4 rustdoc: some code style improvements 2015-09-20 13:24:47 +03:00
Simon Mazur
b8cfa59be0 rustdoc: Changed section headers anchor rendering 2015-09-20 13:12:27 +03:00
Steve Klabnik
6872d13e96 Rollup merge of #28400 - badboy:disable-browser-history-on-file, r=steveklabnik
history.pushState is defined, but not working whenever document.origin is "null"
(literally that string, not just the null object).
This is due to some security considerations and is unlikely to be ever working.

For now just disable the usage of the history API when the documentation
is accessed through a file:/// URL.

See https://code.google.com/p/chromium/issues/detail?id=301210 for a
Chrome-specific issue on the history API on file:/// URLs

Closes #25953
2015-09-19 11:15:47 -04:00