Skip to content

Commit a076961

Browse files
committed
Re-implement rustbook in terms of mdbook
mdbook has a lot of optional dependencies that we don't want, so instead of using it directly, we re-build rustbook to use mdbook as a library. For convenience' sake, we keep the same CLI interface as mdbook; the only difference is that it only accepts build and test subcommands, rather than the full range.
1 parent 717ac96 commit a076961

File tree

19 files changed

+311
-972
lines changed

19 files changed

+311
-972
lines changed

src/Cargo.lock

Lines changed: 215 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/doc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub fn rustbook(build: &Build, target: &str, name: &str) {
4747
build.run(build.tool_cmd(&compiler, "rustbook")
4848
.arg("build")
4949
.arg(&src)
50+
.arg("-d")
5051
.arg(out));
5152
}
5253

src/doc/book/src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Summary
2+
3+
- [Chapter 1](./chapter_1.md)

src/doc/book/src/chapter_1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Chapter 1

src/doc/nomicon/src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Summary
2+
3+
- [Chapter 1](./chapter_1.md)

src/doc/nomicon/src/chapter_1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Chapter 1

src/tools/rustbook/Cargo.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[package]
22
authors = ["The Rust Project Developers"]
33
name = "rustbook"
4-
version = "0.0.0"
5-
build = false
4+
version = "0.1.0"
5+
license = "MIT/Apache-2.0"
66

7-
[[bin]]
8-
name = "rustbook"
9-
path = "main.rs"
7+
[dependencies]
8+
clap = "2.19.3"
9+
10+
[dependencies.mdbook]
11+
version = "0.0.14"
12+
default-features = false

0 commit comments

Comments
 (0)