about summary refs log tree commit diff
path: root/src/rustbook
AgeCommit message (Collapse)AuthorLines
2016-03-08rustbuild: Move rustbook to a `src/tools` directoryAlex Crichton-987/+0
We've actually got quite a few tools that are compiled as part of our build, let's start housing them all in a `tools` directory.
2016-02-11rustbook: Make `main` a public functionAlex Crichton-1/+1
This will allow it to be used as a crate in a Cargo-based build
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+13
These describe the structure of all our crate dependencies.
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-4/+3
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
2015-09-28fixes #17017 (update padding:11px line 142 of rustbook.css)Willy Aguirre-1/+1
2015-09-25rustbook: Decrease the max-width for the mobile viewNick Howell-1/+1
This should fix #22682. "max-width: 1023px" seems like a good compromise here. This way, 1024x768 monitors will still see the sidebar (plus, iPad in landscape mode).
2015-09-25Cleanup rustbook.css and fix some padding issuesNick Howell-43/+27
2015-09-24rustbook: Inline javascript.rs into build.rsNick Howell-35/+17
There's no need for javascript.rs now that its contents were moved into .js files. Also, adjust a couple variable names and some indentation in build.rs.
2015-09-24Replace occurrences of "rust-book" with "rustbook"Nick Howell-7/+7
2015-09-24Cleanup rustbook.js and add 'use strict'Nick Howell-54/+59
Mostly indentation fixes, but a little refactoring, too.
2015-09-20Miscellaneous cleanup for old issues.Lee Jeffery-1/+0
2015-09-04rustbook: Fix relative links on the Introduction pageNick Howell-7/+7
The Introduction page generated by rustbook used weird relative links like "./getting-started.html" instead of just "getting-started.html" like on the other pages. This adversely affected Windows builds the worst, since it generated links like ".\getting-started.html" (note the backslash). If you then try to upload the generated book to a webserver, you end up with 404's. See this example of what is going on with the Introduction page links and why this PR should fix it: http://is.gd/fRUTXk Compare the links on these two pages, for instance: https://doc.rust-lang.org/nightly/book/ https://doc.rust-lang.org/nightly/book/getting-started.html Also, fix a few whitespace issues in build.rs.
2015-08-26Remove redundant overflowing ruleArtem Shitov-1/+0
2015-08-26Fix keyboard scrolling in rustbookArtem Shitov-2/+1
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-1/+1
Also fixes a few outdated links.
2015-07-27Fix the relative path issue by including the files using include_bytes!Mathieu David-59/+62
2015-07-15doc: add rel=prev/next for links to adjacent sectionsVincent Bernat-0/+2
This help people using keyboard navigation or with disabilities to easily browse through pagination. For example, in Vimium, a reader can do `[[` or `]]` to browse through the pages.
2015-06-25removed open sans fontMathieu David-4/+1
2015-06-24Fix licenseMathieu David-0/+22
2015-06-24separate css and js from rustMathieu David-82/+75
2015-06-24Add class to last paragraph that contains next and previous navigation links ↵Mathieu David-0/+5
to add bigger margin
2015-06-24Fixed line longer than 100 charsMathieu David-1/+2
2015-06-24Some love for the rustbook, added Open Sans font, made the sidebar more ↵Mathieu David-8/+34
beautiful with more space and colors, added some style to the code blocks
2015-06-22Auto merge of #26037 - nhowell:plain_js_playpen, r=steveklabnikbors-6/+2
Since the "Book" already avoids jQuery in its inline script tags and playpen.js is tiny, I figured I would convert it to plain old JS as well. Side note: This is a separate issue, but another thing I noticed in my testing is that the "⇱" character doesn't display correctly in Chrome on Windows 7. (Firefox and IE work fine; other browsers not tested) r? @steveklabnik Edit: Github didn't like the "script" tag above Edit 2: Actually, now IE seems to render "⇱" fine for me. Odd.
2015-06-17More test fixes and fallout of stability changesAlex Crichton-3/+7
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-1/+1
2015-06-17collections: Split the `collections` featureAlex Crichton-3/+3
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-12Convert playpen.js to plain JS.Nick Howell-6/+2
It is still compatible with IE9+. This removes the jQuery dependency from the "Book" entirely.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-06-06fix path in toc linksfunkill-1/+1
2015-05-17Add 'active' class to current page in rustbook table of contentsSean Collins-9/+21
2015-05-13Delete `_book` folder if it exists from previous runsmdinger-0/+6
2015-04-25rustbook: Fixes display of navigation links in README.html.Johannes Oertel-1/+1
2015-04-10Auto merge of #24177 - alexcrichton:rustdoc, r=aturonbors-1/+13
This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable). I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.
2015-04-07book: Fix a hyperlink to CONFIGS.mdAlex Crichton-1/+2
Right now rustdoc replaces the string ".md)" with ".html)" to fix links between markdown files, so use a different syntax that doesn't get caught in the crossfire. Closes #22900
2015-04-07book: Emit links to play.rust-lang.org to run examplesAlex Crichton-0/+11
Had to fix a bug in `--markdown-playground-url` for markdown files in rustdoc as well as adding some necessary JS to the rustbook output as well. Closes #21553
2015-04-08Make `sum` and `product` inherent methods on `Iterator`Tobias Bucher-2/+1
In addition to being nicer, this also allows you to use `sum` and `product` for iterators yielding custom types aside from the standard integers. Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this is a breaking change. [breaking-change]
2015-03-31Stabilize `std::convert` and related codeAaron Turon-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change]
2015-03-25Add trivial cast lints.Nick Cameron-5/+5
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-23rollup merge of #23541: aturon/stab-errorAlex Crichton-0/+1
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change] r? @alexcrichton Closes #21790
2015-03-23Add generic conversion traitsAaron Turon-7/+8
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23Stabilize the Error traitAaron Turon-0/+1
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change]
2015-03-18Register new snapshotsAlex Crichton-0/+1
2015-03-13Fallout of std::old_io deprecationAlex Crichton-6/+5
2015-03-12Stabilize std::pathAaron Turon-1/+0
This commit stabilizes essentially all of the new `std::path` API. The API itself is changed in a couple of ways (which brings it in closer alignment with the RFC): * `.` components are now normalized away, unless they appear at the start of a path. This in turn effects the semantics of e.g. asking for the file name of `foo/` or `foo/.`, both of which yield `Some("foo")` now. This semantics is what the original RFC specified, and is also desirable given early experience rolling out the new API. * The `parent` function now succeeds if, and only if, the path has at least one non-root/prefix component. This change affects `pop` as well. * The `Prefix` component now involves a separate `PrefixComponent` struct, to better allow for keeping both parsed and unparsed prefix data. In addition, the `old_path` module is now deprecated. Closes #23264 [breaking-change]
2015-03-05std: Stabilize the `fs` moduleAlex Crichton-3/+4
This commit performs a stabilization pass over the `std::fs` module now that it's had some time to bake. The change was largely just adding `#[stable]` tags, but there are a few APIs that remain `#[unstable]`. The following apis are now marked `#[stable]`: * `std::fs` (the name) * `File` * `Metadata` * `ReadDir` * `DirEntry` * `OpenOptions` * `Permissions` * `File::{open, create}` * `File::{sync_all, sync_data}` * `File::set_len` * `File::metadata` * Trait implementations for `File` and `&File` * `OpenOptions::new` * `OpenOptions::{read, write, append, truncate, create}` * `OpenOptions::open` - this function was modified, however, to not attempt to reject cross-platform openings of directories. This means that some platforms will succeed in opening a directory and others will fail. * `Metadata::{is_dir, is_file, len, permissions}` * `Permissions::{readonly, set_readonly}` * `Iterator for ReadDir` * `DirEntry::path` * `remove_file` - like with `OpenOptions::open`, the extra windows code to remove a readonly file has been removed. This means that removing a readonly file will succeed on some platforms but fail on others. * `metadata` * `rename` * `copy` * `hard_link` * `soft_link` * `read_link` * `create_dir` * `create_dir_all` * `remove_dir` * `remove_dir_all` * `read_dir` The following apis remain `#[unstable]`. * `WalkDir` and `walk` - there are many methods by which a directory walk can be constructed, and it's unclear whether the current semantics are the right ones. For example symlinks are not handled super well currently. This is now behind a new `fs_walk` feature. * `File::path` - this is an extra abstraction which the standard library provides on top of what the system offers and it's unclear whether we should be doing so. This is now behind a new `file_path` feature. * `Metadata::{accessed, modified}` - we do not currently have a good abstraction for a moment in time which is what these APIs should likely be returning, so these remain `#[unstable]` for now. These are now behind a new `fs_time` feature * `set_file_times` - like with `Metadata::accessed`, we do not currently have the appropriate abstraction for the arguments here so this API remains unstable behind the `fs_time` feature gate. * `PathExt` - the precise set of methods on this trait may change over time and some methods may be removed. This API remains unstable behind the `path_ext` feature gate. * `set_permissions` - we may wish to expose a more granular ability to set the permissions on a file instead of just a blanket "set all permissions" method. This function remains behind the `fs` feature. The following apis are now `#[deprecated]` * The `TempDir` type is now entirely deprecated and is [located on crates.io][tempdir] as the `tempdir` crate with [its source][github] at rust-lang/tempdir. [tempdir]: https://crates.io/crates/tempdir [github]: https://github.com/rust-lang/tempdir The stability of some of these APIs has been questioned over the past few weeks in using these APIs, and it is intentional that the majority of APIs here are marked `#[stable]`. The `std::fs` module has a lot of room to grow and the material is [being tracked in a RFC issue][rfc-issue]. [rfc-issue]: https://github.com/rust-lang/rfcs/issues/939 [breaking-change]
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-140/+92
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-02-26remove some compiler warningsTshepang Lekhonkhobe-4/+4
2015-02-25Use os::getcwd instead of env in rustbook (fixup #22727)Manish Goregaokar-4/+6
2015-02-23Rollup merge of #22688 - tshepang:use-new-slicing-syntax, r=alexcrichtonManish Goregaokar-13/+13