Skip to content

Commit

Permalink
Auto merge of #61948 - ehuss:update-mdbook, r=steveklabnik
Browse files Browse the repository at this point in the history
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 3ac9cfc9c9ab2e366feebf18718112737f572352..f55e97c145cf37fd664db2e0e2f2d05df328bf4f
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)
  • Loading branch information
bors committed Jun 21, 2019
2 parents 9d5b6ef + 2dafa91 commit dbec74f
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 48 deletions.
137 changes: 117 additions & 20 deletions Cargo.lock

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ macro_rules! book {
// NOTE: When adding a book here, make sure to ALSO build the book by
// adding a build step in `src/bootstrap/builder.rs`!
book!(
EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::MdBook2;
EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::MdBook2;
Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::MdBook2;
EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::Latest;
EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::Latest;
Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::Latest;
Reference, "src/doc/reference", "reference", RustbookVersion::MdBook1;
RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::MdBook2;
RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::Latest;
RustcBook, "src/doc/rustc", "rustc", RustbookVersion::MdBook1;
RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::MdBook2;
RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::Latest;
);

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
enum RustbookVersion {
MdBook1,
MdBook2,
Latest,
}

fn doc_src(builder: &Builder<'_>) -> Interned<PathBuf> {
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Step for UnstableBook {
target: self.target,
name: INTERNER.intern_str("unstable-book"),
src: builder.md_doc_out(self.target),
version: RustbookVersion::MdBook2,
version: RustbookVersion::Latest,
})
}
}
Expand Down Expand Up @@ -196,7 +196,7 @@ impl Step for RustbookSrc {

let vers = match self.version {
RustbookVersion::MdBook1 => "1",
RustbookVersion::MdBook2 => "2",
RustbookVersion::Latest => "3",
};

builder.run(rustbook_cmd
Expand Down Expand Up @@ -251,7 +251,7 @@ impl Step for TheBook {
builder.ensure(RustbookSrc {
target,
name: INTERNER.intern_string(name.to_string()),
version: RustbookVersion::MdBook2,
version: RustbookVersion::Latest,
src: doc_src(builder),
});

Expand All @@ -261,23 +261,23 @@ impl Step for TheBook {
builder.ensure(RustbookSrc {
target,
name: INTERNER.intern_string(source_name),
version: RustbookVersion::MdBook2,
version: RustbookVersion::Latest,
src: doc_src(builder),
});

let source_name = format!("{}/second-edition", name);
builder.ensure(RustbookSrc {
target,
name: INTERNER.intern_string(source_name),
version: RustbookVersion::MdBook2,
version: RustbookVersion::Latest,
src: doc_src(builder),
});

let source_name = format!("{}/2018-edition", name);
builder.ensure(RustbookSrc {
target,
name: INTERNER.intern_string(source_name),
version: RustbookVersion::MdBook2,
version: RustbookVersion::Latest,
src: doc_src(builder),
});

Expand Down
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 49 files
+1 −1 CONTRIBUTING.md
+2 −2 README.md
+1 −0 ci/dictionary.txt
+0 −54 nostarch/chapter18-destructuring-nested-structs-and-enums.md
+0 −31 nostarch/chapter19-new-function-pointer-text.md
+0 −579 nostarch/chapter19.md
+ nostarch/docx/chapter18-destructuring-nested-structs-and-enums.docx
+ nostarch/docx/chapter19-new-function-pointer-text.docx
+ nostarch/docx/chapter19.docx
+6 −6 src/appendix-02-operators.md
+6 −6 src/appendix-03-derivable-traits.md
+5 −5 src/appendix-04-useful-development-tools.md
+1 −0 src/appendix-05-editions.md
+1 −0 src/appendix-06-translation.md
+4 −4 src/ch01-03-hello-cargo.md
+5 −5 src/ch02-00-guessing-game-tutorial.md
+5 −4 src/ch03-02-data-types.md
+3 −2 src/ch03-05-control-flow.md
+13 −14 src/ch07-00-managing-growing-projects-with-packages-crates-and-modules.md
+8 −6 src/ch07-01-packages-and-crates.md
+23 −23 src/ch07-02-defining-modules-to-control-scope-and-privacy.md
+17 −16 src/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md
+10 −10 src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md
+1 −1 src/ch08-02-strings.md
+4 −3 src/ch08-03-hash-maps.md
+3 −3 src/ch09-01-unrecoverable-errors-with-panic.md
+8 −7 src/ch10-02-traits.md
+10 −9 src/ch10-03-lifetime-syntax.md
+8 −8 src/ch11-01-writing-tests.md
+1 −1 src/ch12-01-accepting-command-line-arguments.md
+9 −8 src/ch12-03-improving-error-handling-and-modularity.md
+2 −2 src/ch14-00-more-about-cargo.md
+9 −9 src/ch14-02-publishing-to-crates-io.md
+5 −5 src/ch14-03-cargo-workspaces.md
+1 −1 src/ch14-04-installing-binaries.md
+2 −2 src/ch14-05-extending-cargo.md
+2 −2 src/ch16-04-extensible-concurrency-sync-and-send.md
+11 −11 src/ch17-02-trait-objects.md
+8 −7 src/ch18-01-all-the-places-for-patterns.md
+17 −18 src/ch19-01-unsafe-rust.md
+21 −21 src/ch19-03-advanced-traits.md
+8 −8 src/ch19-04-advanced-types.md
+3 −3 src/ch19-05-advanced-functions-and-closures.md
+24 −23 src/ch19-06-macros.md
+3 −2 src/ch20-00-final-project-a-web-server.md
+3 −3 src/ch20-03-graceful-shutdown-and-cleanup.md
+22 −0 tools/megadiff.sh
+1 −0 tools/src/bin/link2print.rs
+2 −2 tools/src/bin/remove_links.rs
2 changes: 1 addition & 1 deletion src/doc/edition-guide
2 changes: 1 addition & 1 deletion src/doc/embedded-book
2 changes: 1 addition & 1 deletion src/doc/reference
2 changes: 1 addition & 1 deletion src/doc/rustc-guide
5 changes: 2 additions & 3 deletions src/tools/rustbook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ edition = "2018"
[dependencies]
clap = "2.25.0"

[dependencies.mdbook_2]
package = "mdbook"
version = "0.2.3"
[dependencies.mdbook]
version = "0.3.0"
default-features = false
features = ["search"]

Expand Down
14 changes: 7 additions & 7 deletions src/tools/rustbook/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use clap::{App, ArgMatches, SubCommand, AppSettings};
use mdbook_1::{MDBook as MDBook1};
use mdbook_1::errors::{Result as Result1};

use mdbook_2::{MDBook as MDBook2};
use mdbook_2::errors::{Result as Result2};
use mdbook::MDBook;
use mdbook::errors::Result;

fn main() {
let d_message = "-d, --dest-dir=[dest-dir]
Expand Down Expand Up @@ -48,8 +48,8 @@ fn main() {
::std::process::exit(101);
}
}
Some("2") => {
if let Err(e) = build_2(sub_matches) {
Some("2") | Some("3") => {
if let Err(e) = build(sub_matches) {
eprintln!("Error: {}", e);

for cause in e.iter().skip(1) {
Expand All @@ -60,7 +60,7 @@ fn main() {
}
}
_ => {
panic!("Invalid mdBook version! Select '1' or '2'");
panic!("Invalid mdBook version! Select '1' or '2' or '3'");
}
};
},
Expand All @@ -86,9 +86,9 @@ pub fn build_1(args: &ArgMatches<'_>) -> Result1<()> {
}

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

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

0 comments on commit dbec74f

Please sign in to comment.