From b77942d3c8e2d62648536b317e426b5ef404d9bf Mon Sep 17 00:00:00 2001 From: Camelid <37223377+camelid@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:16:09 -0700 Subject: [PATCH] Rename `book-example` to `guide` (#1336) `book-example` is a bit of a strange name given that it's not just an example. --- .github/workflows/deploy.yml | 6 +++--- .gitignore | 2 +- Cargo.toml | 2 +- {book-example => guide}/book.toml | 0 {book-example => guide}/src/404.md | 0 {book-example => guide}/src/README.md | 0 {book-example => guide}/src/SUMMARY.md | 0 {book-example => guide}/src/cli/README.md | 0 {book-example => guide}/src/cli/build.md | 0 {book-example => guide}/src/cli/clean.md | 0 {book-example => guide}/src/cli/init.md | 0 {book-example => guide}/src/cli/serve.md | 0 {book-example => guide}/src/cli/test.md | 0 {book-example => guide}/src/cli/watch.md | 0 {book-example => guide}/src/continuous-integration.md | 0 {book-example => guide}/src/for_developers/README.md | 0 {book-example => guide}/src/for_developers/backends.md | 0 .../src/for_developers/mdbook-wordcount/Cargo.toml | 0 .../src/for_developers/mdbook-wordcount/src/main.rs | 0 {book-example => guide}/src/for_developers/preprocessors.md | 0 {book-example => guide}/src/format/README.md | 0 {book-example => guide}/src/format/config.md | 0 {book-example => guide}/src/format/example.rs | 0 {book-example => guide}/src/format/mathjax.md | 0 {book-example => guide}/src/format/mdbook.md | 0 {book-example => guide}/src/format/summary.md | 0 {book-example => guide}/src/format/theme/README.md | 0 {book-example => guide}/src/format/theme/editor.md | 0 {book-example => guide}/src/format/theme/index-hbs.md | 0 .../src/format/theme/syntax-highlighting.md | 0 {book-example => guide}/src/misc/contributors.md | 0 {book-example => guide}/src/misc/introduction.md | 0 src/preprocess/cmd.rs | 6 +++--- tests/dummy_book/mod.rs | 6 +++--- tests/rendered_output.rs | 2 +- 35 files changed, 12 insertions(+), 12 deletions(-) rename {book-example => guide}/book.toml (100%) rename {book-example => guide}/src/404.md (100%) rename {book-example => guide}/src/README.md (100%) rename {book-example => guide}/src/SUMMARY.md (100%) rename {book-example => guide}/src/cli/README.md (100%) rename {book-example => guide}/src/cli/build.md (100%) rename {book-example => guide}/src/cli/clean.md (100%) rename {book-example => guide}/src/cli/init.md (100%) rename {book-example => guide}/src/cli/serve.md (100%) rename {book-example => guide}/src/cli/test.md (100%) rename {book-example => guide}/src/cli/watch.md (100%) rename {book-example => guide}/src/continuous-integration.md (100%) rename {book-example => guide}/src/for_developers/README.md (100%) rename {book-example => guide}/src/for_developers/backends.md (100%) rename {book-example => guide}/src/for_developers/mdbook-wordcount/Cargo.toml (100%) rename {book-example => guide}/src/for_developers/mdbook-wordcount/src/main.rs (100%) rename {book-example => guide}/src/for_developers/preprocessors.md (100%) rename {book-example => guide}/src/format/README.md (100%) rename {book-example => guide}/src/format/config.md (100%) rename {book-example => guide}/src/format/example.rs (100%) rename {book-example => guide}/src/format/mathjax.md (100%) rename {book-example => guide}/src/format/mdbook.md (100%) rename {book-example => guide}/src/format/summary.md (100%) rename {book-example => guide}/src/format/theme/README.md (100%) rename {book-example => guide}/src/format/theme/editor.md (100%) rename {book-example => guide}/src/format/theme/index-hbs.md (100%) rename {book-example => guide}/src/format/theme/syntax-highlighting.md (100%) rename {book-example => guide}/src/misc/contributors.md (100%) rename {book-example => guide}/src/misc/introduction.md (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a3f6b700..cc01f5b5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,12 +31,12 @@ jobs: - name: Install Rust (rustup) run: rustup update stable --no-self-update && rustup default stable - name: Build book - run: cargo run -- build book-example + run: cargo run -- build guide - name: Deploy to GitHub env: GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }} run: | - touch book-example/book/.nojekyll + touch guide/book/.nojekyll curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy - cd book-example/book + cd guide/book /tmp/deploy diff --git a/.gitignore b/.gitignore index c79fe427..36614264 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ target .DS_Store book-test -book-example/book +guide/book .vscode tests/dummy_book/book/ diff --git a/Cargo.toml b/Cargo.toml index 37a59a0e..e68a2235 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = [ ] documentation = "http://rust-lang.github.io/mdBook/index.html" edition = "2018" -exclude = ["/book-example/*"] +exclude = ["/guide/*"] keywords = ["book", "gitbook", "rustbook", "markdown"] license = "MPL-2.0" readme = "README.md" diff --git a/book-example/book.toml b/guide/book.toml similarity index 100% rename from book-example/book.toml rename to guide/book.toml diff --git a/book-example/src/404.md b/guide/src/404.md similarity index 100% rename from book-example/src/404.md rename to guide/src/404.md diff --git a/book-example/src/README.md b/guide/src/README.md similarity index 100% rename from book-example/src/README.md rename to guide/src/README.md diff --git a/book-example/src/SUMMARY.md b/guide/src/SUMMARY.md similarity index 100% rename from book-example/src/SUMMARY.md rename to guide/src/SUMMARY.md diff --git a/book-example/src/cli/README.md b/guide/src/cli/README.md similarity index 100% rename from book-example/src/cli/README.md rename to guide/src/cli/README.md diff --git a/book-example/src/cli/build.md b/guide/src/cli/build.md similarity index 100% rename from book-example/src/cli/build.md rename to guide/src/cli/build.md diff --git a/book-example/src/cli/clean.md b/guide/src/cli/clean.md similarity index 100% rename from book-example/src/cli/clean.md rename to guide/src/cli/clean.md diff --git a/book-example/src/cli/init.md b/guide/src/cli/init.md similarity index 100% rename from book-example/src/cli/init.md rename to guide/src/cli/init.md diff --git a/book-example/src/cli/serve.md b/guide/src/cli/serve.md similarity index 100% rename from book-example/src/cli/serve.md rename to guide/src/cli/serve.md diff --git a/book-example/src/cli/test.md b/guide/src/cli/test.md similarity index 100% rename from book-example/src/cli/test.md rename to guide/src/cli/test.md diff --git a/book-example/src/cli/watch.md b/guide/src/cli/watch.md similarity index 100% rename from book-example/src/cli/watch.md rename to guide/src/cli/watch.md diff --git a/book-example/src/continuous-integration.md b/guide/src/continuous-integration.md similarity index 100% rename from book-example/src/continuous-integration.md rename to guide/src/continuous-integration.md diff --git a/book-example/src/for_developers/README.md b/guide/src/for_developers/README.md similarity index 100% rename from book-example/src/for_developers/README.md rename to guide/src/for_developers/README.md diff --git a/book-example/src/for_developers/backends.md b/guide/src/for_developers/backends.md similarity index 100% rename from book-example/src/for_developers/backends.md rename to guide/src/for_developers/backends.md diff --git a/book-example/src/for_developers/mdbook-wordcount/Cargo.toml b/guide/src/for_developers/mdbook-wordcount/Cargo.toml similarity index 100% rename from book-example/src/for_developers/mdbook-wordcount/Cargo.toml rename to guide/src/for_developers/mdbook-wordcount/Cargo.toml diff --git a/book-example/src/for_developers/mdbook-wordcount/src/main.rs b/guide/src/for_developers/mdbook-wordcount/src/main.rs similarity index 100% rename from book-example/src/for_developers/mdbook-wordcount/src/main.rs rename to guide/src/for_developers/mdbook-wordcount/src/main.rs diff --git a/book-example/src/for_developers/preprocessors.md b/guide/src/for_developers/preprocessors.md similarity index 100% rename from book-example/src/for_developers/preprocessors.md rename to guide/src/for_developers/preprocessors.md diff --git a/book-example/src/format/README.md b/guide/src/format/README.md similarity index 100% rename from book-example/src/format/README.md rename to guide/src/format/README.md diff --git a/book-example/src/format/config.md b/guide/src/format/config.md similarity index 100% rename from book-example/src/format/config.md rename to guide/src/format/config.md diff --git a/book-example/src/format/example.rs b/guide/src/format/example.rs similarity index 100% rename from book-example/src/format/example.rs rename to guide/src/format/example.rs diff --git a/book-example/src/format/mathjax.md b/guide/src/format/mathjax.md similarity index 100% rename from book-example/src/format/mathjax.md rename to guide/src/format/mathjax.md diff --git a/book-example/src/format/mdbook.md b/guide/src/format/mdbook.md similarity index 100% rename from book-example/src/format/mdbook.md rename to guide/src/format/mdbook.md diff --git a/book-example/src/format/summary.md b/guide/src/format/summary.md similarity index 100% rename from book-example/src/format/summary.md rename to guide/src/format/summary.md diff --git a/book-example/src/format/theme/README.md b/guide/src/format/theme/README.md similarity index 100% rename from book-example/src/format/theme/README.md rename to guide/src/format/theme/README.md diff --git a/book-example/src/format/theme/editor.md b/guide/src/format/theme/editor.md similarity index 100% rename from book-example/src/format/theme/editor.md rename to guide/src/format/theme/editor.md diff --git a/book-example/src/format/theme/index-hbs.md b/guide/src/format/theme/index-hbs.md similarity index 100% rename from book-example/src/format/theme/index-hbs.md rename to guide/src/format/theme/index-hbs.md diff --git a/book-example/src/format/theme/syntax-highlighting.md b/guide/src/format/theme/syntax-highlighting.md similarity index 100% rename from book-example/src/format/theme/syntax-highlighting.md rename to guide/src/format/theme/syntax-highlighting.md diff --git a/book-example/src/misc/contributors.md b/guide/src/misc/contributors.md similarity index 100% rename from book-example/src/misc/contributors.md rename to guide/src/misc/contributors.md diff --git a/book-example/src/misc/introduction.md b/guide/src/misc/introduction.md similarity index 100% rename from book-example/src/misc/introduction.md rename to guide/src/misc/introduction.md diff --git a/src/preprocess/cmd.rs b/src/preprocess/cmd.rs index 625c143b..f9c64e28 100644 --- a/src/preprocess/cmd.rs +++ b/src/preprocess/cmd.rs @@ -171,15 +171,15 @@ mod tests { use crate::MDBook; use std::path::Path; - fn book_example() -> MDBook { - let example = Path::new(env!("CARGO_MANIFEST_DIR")).join("book-example"); + fn guide() -> MDBook { + let example = Path::new(env!("CARGO_MANIFEST_DIR")).join("guide"); MDBook::load(example).unwrap() } #[test] fn round_trip_write_and_parse_input() { let cmd = CmdPreprocessor::new("test".to_string(), "test".to_string()); - let md = book_example(); + let md = guide(); let ctx = PreprocessorContext::new( md.root.clone(), md.config.clone(), diff --git a/tests/dummy_book/mod.rs b/tests/dummy_book/mod.rs index a395c2df..d9d9a068 100644 --- a/tests/dummy_book/mod.rs +++ b/tests/dummy_book/mod.rs @@ -135,11 +135,11 @@ fn recursive_copy, B: AsRef>(from: A, to: B) -> Result<()> } pub fn new_copy_of_example_book() -> Result { - let temp = TempFileBuilder::new().prefix("book-example").tempdir()?; + let temp = TempFileBuilder::new().prefix("guide").tempdir()?; - let book_example = Path::new(env!("CARGO_MANIFEST_DIR")).join("book-example"); + let guide = Path::new(env!("CARGO_MANIFEST_DIR")).join("guide"); - recursive_copy(book_example, temp.path())?; + recursive_copy(guide, temp.path())?; Ok(temp) } diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index 4f0568dc..6234c29b 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -345,7 +345,7 @@ fn create_missing_file_with_config() { } /// This makes sure you can include a Rust file with `{{#playground example.rs}}`. -/// Specification is in `book-example/src/format/rust.md` +/// Specification is in `guide/src/format/rust.md` #[test] fn able_to_include_playground_files_in_chapters() { let temp = DummyBook::new().build().unwrap();