Skip to content

Commit dbec74f

Browse files
committed
Auto merge of #61948 - ehuss:update-mdbook, r=steveklabnik
Update mdbook This updates to mdbook 0.3.0. This release includes the following changes: https://github.com/rust-lang-nursery/mdBook/blob/master/CHANGELOG.md#mdbook-030 One of the biggest changes is the update to pulldown-cmark. This also bumps the submodules (except the nomicon which has some broken links). ## reference 6 commits in f8ae436..08ae27a 2019-05-31 14:59:12 +0200 to 2019-06-17 11:24:13 -0700 - Document `underscore_const_names` (rust-lang/reference#620) - Describe `#[repr(align(x))]` semantics on `enum`s (rust-lang/reference#619) - Fix typo in lazy_static example. (rust-lang/reference#622) - Rust 2015 supports Kleene ? macro operator (rust-lang/reference#617) - Bitrig support has been removed (rust-lang/reference#615) - Fix spell error in attributes/diagnostics.md (rust-lang/reference#614) ## book 8 commits in 62a8c6f25fbd981c80a046f3b04be9684749af3b..9aacfcc4c5b102c8cda195932addefd32fe955d2 2019-05-28 15:48:23 -0400 to 2019-06-16 21:27:26 -0400 - Add a script to help diff rendered books - Update mdbook links (rust-lang/book#1989) - Update for markdown changes. (rust-lang/book#1984) - Make all mentions of crates.io consistent - Propagate corrections made in layout - Add link to Swedish translation - Propagate small edits made in layout - Remove snapshot files that have been checked with layout ## rust-by-example 3 commits in d8eec1dd65470b9a68e80ac1cba8fad0daac4916..b27472962986e85c94f4183b1a6d2207660d3ed6 2019-06-08 10:15:22 -0300 to 2019-06-17 15:52:07 -0300 - Update `macro_rules!` formatting. (rust-lang/rust-by-example#1205) - Add Cargo comment to the `try!` macro example. (rust-lang/rust-by-example#1203) - Fix typo (rust-lang/rust-by-example#1204) ## rustc-guide 15 commits in 3ac9cfc..f55e97c 2019-06-02 19:36:58 -0500 to 2019-06-15 17:29:12 -0500 - fix typos - Update for TyCtxt<'a, 'gcx, 'tcx> -> TyCtxt<'tcx>. - fix ci failures, typos, broken links - Some edits to address review comments - Notes about closure de-sugaring - add note about rebuilding llvm - Changes to config.toml require a clean - Fix a few typos in type inference chapter - Add triagebot (rust-lang/rustc-dev-guide#337) - Update how-to-build-and-run.md - Update how-to-build-and-run.md - Update compiler-debugging.md - use debug instead of debuginfo-level - Replaced tabs with spaces - correct indentation ## edition-guide 4 commits in 581c6cccfaf995394ea9dcac362dc8e731c18558..f8072acde5ce29c7570d7986180bbded2d22e287 2019-05-06 12:47:44 -0700 to 2019-06-14 23:27:05 +0200 - Small fixes (rust-lang/edition-guide#179) - Cleanup unused NLL link (rust-lang/edition-guide#167) - Part 2: Rust 2015 now supports ? macro rep op (rust-lang/edition-guide#163) - Part 1: Rust 2015 now supports ? macro rep op (rust-lang/edition-guide#162) ## embedded-book 1 commits in f0c75b75f9c18537b78f5d17c1015247e9a49c86..ef27b517dcd0b990c888c0d7caeff52a5a115619 2019-06-03 10:49:02 +0000 to 2019-06-18 22:59:47 +0000 - Fix link for more strict commonmark interpretation. (rust-embedded/book#194)
2 parents 9d5b6ef + 2dafa91 commit dbec74f

File tree

10 files changed

+144
-48
lines changed

10 files changed

+144
-48
lines changed

Cargo.lock

+117-20
Large diffs are not rendered by default.

src/bootstrap/doc.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ macro_rules! book {
6161
// NOTE: When adding a book here, make sure to ALSO build the book by
6262
// adding a build step in `src/bootstrap/builder.rs`!
6363
book!(
64-
EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::MdBook2;
65-
EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::MdBook2;
66-
Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::MdBook2;
64+
EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::Latest;
65+
EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::Latest;
66+
Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::Latest;
6767
Reference, "src/doc/reference", "reference", RustbookVersion::MdBook1;
68-
RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::MdBook2;
68+
RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::Latest;
6969
RustcBook, "src/doc/rustc", "rustc", RustbookVersion::MdBook1;
70-
RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::MdBook2;
70+
RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::Latest;
7171
);
7272

7373
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7474
enum RustbookVersion {
7575
MdBook1,
76-
MdBook2,
76+
Latest,
7777
}
7878

7979
fn doc_src(builder: &Builder<'_>) -> Interned<PathBuf> {
@@ -108,7 +108,7 @@ impl Step for UnstableBook {
108108
target: self.target,
109109
name: INTERNER.intern_str("unstable-book"),
110110
src: builder.md_doc_out(self.target),
111-
version: RustbookVersion::MdBook2,
111+
version: RustbookVersion::Latest,
112112
})
113113
}
114114
}
@@ -196,7 +196,7 @@ impl Step for RustbookSrc {
196196

197197
let vers = match self.version {
198198
RustbookVersion::MdBook1 => "1",
199-
RustbookVersion::MdBook2 => "2",
199+
RustbookVersion::Latest => "3",
200200
};
201201

202202
builder.run(rustbook_cmd
@@ -251,7 +251,7 @@ impl Step for TheBook {
251251
builder.ensure(RustbookSrc {
252252
target,
253253
name: INTERNER.intern_string(name.to_string()),
254-
version: RustbookVersion::MdBook2,
254+
version: RustbookVersion::Latest,
255255
src: doc_src(builder),
256256
});
257257

@@ -261,23 +261,23 @@ impl Step for TheBook {
261261
builder.ensure(RustbookSrc {
262262
target,
263263
name: INTERNER.intern_string(source_name),
264-
version: RustbookVersion::MdBook2,
264+
version: RustbookVersion::Latest,
265265
src: doc_src(builder),
266266
});
267267

268268
let source_name = format!("{}/second-edition", name);
269269
builder.ensure(RustbookSrc {
270270
target,
271271
name: INTERNER.intern_string(source_name),
272-
version: RustbookVersion::MdBook2,
272+
version: RustbookVersion::Latest,
273273
src: doc_src(builder),
274274
});
275275

276276
let source_name = format!("{}/2018-edition", name);
277277
builder.ensure(RustbookSrc {
278278
target,
279279
name: INTERNER.intern_string(source_name),
280-
version: RustbookVersion::MdBook2,
280+
version: RustbookVersion::Latest,
281281
src: doc_src(builder),
282282
});
283283

src/doc/book

Submodule book updated 49 files

src/doc/edition-guide

src/doc/embedded-book

src/doc/reference

src/doc/rustc-guide

src/tools/rustbook/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ edition = "2018"
88
[dependencies]
99
clap = "2.25.0"
1010

11-
[dependencies.mdbook_2]
12-
package = "mdbook"
13-
version = "0.2.3"
11+
[dependencies.mdbook]
12+
version = "0.3.0"
1413
default-features = false
1514
features = ["search"]
1615

src/tools/rustbook/src/main.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use clap::{App, ArgMatches, SubCommand, AppSettings};
1010
use mdbook_1::{MDBook as MDBook1};
1111
use mdbook_1::errors::{Result as Result1};
1212

13-
use mdbook_2::{MDBook as MDBook2};
14-
use mdbook_2::errors::{Result as Result2};
13+
use mdbook::MDBook;
14+
use mdbook::errors::Result;
1515

1616
fn main() {
1717
let d_message = "-d, --dest-dir=[dest-dir]
@@ -48,8 +48,8 @@ fn main() {
4848
::std::process::exit(101);
4949
}
5050
}
51-
Some("2") => {
52-
if let Err(e) = build_2(sub_matches) {
51+
Some("2") | Some("3") => {
52+
if let Err(e) = build(sub_matches) {
5353
eprintln!("Error: {}", e);
5454

5555
for cause in e.iter().skip(1) {
@@ -60,7 +60,7 @@ fn main() {
6060
}
6161
}
6262
_ => {
63-
panic!("Invalid mdBook version! Select '1' or '2'");
63+
panic!("Invalid mdBook version! Select '1' or '2' or '3'");
6464
}
6565
};
6666
},
@@ -86,9 +86,9 @@ pub fn build_1(args: &ArgMatches<'_>) -> Result1<()> {
8686
}
8787

8888
// Build command implementation
89-
pub fn build_2(args: &ArgMatches<'_>) -> Result2<()> {
89+
pub fn build(args: &ArgMatches<'_>) -> Result<()> {
9090
let book_dir = get_book_dir(args);
91-
let mut book = MDBook2::load(&book_dir)?;
91+
let mut book = MDBook::load(&book_dir)?;
9292

9393
// Set this to allow us to catch bugs in advance.
9494
book.config.build.create_missing = false;

0 commit comments

Comments
 (0)