Skip to content

Commit

Permalink
Rename book-example to guide (#1336)
Browse files Browse the repository at this point in the history
`book-example` is a bit of a strange name given that it's not just an
example.
  • Loading branch information
camelid authored Sep 23, 2020
1 parent d0deee9 commit b77942d
Show file tree
Hide file tree
Showing 35 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target
.DS_Store

book-test
book-example/book
guide/book

.vscode
tests/dummy_book/book/
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/preprocess/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions tests/dummy_book/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ fn recursive_copy<A: AsRef<Path>, B: AsRef<Path>>(from: A, to: B) -> Result<()>
}

pub fn new_copy_of_example_book() -> Result<TempDir> {
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)
}
2 changes: 1 addition & 1 deletion tests/rendered_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b77942d

Please sign in to comment.