Rename `book-example` to `guide` (#1336)

`book-example` is a bit of a strange name given that it's not just an
example.
This commit is contained in:
Camelid 2020-09-22 18:16:09 -07:00 committed by GitHub
parent d0deee90b0
commit b77942d3c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 12 additions and 12 deletions

View File

@ -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
.gitignore vendored
View File

@ -4,7 +4,7 @@ target
.DS_Store
book-test
book-example/book
guide/book
.vscode
tests/dummy_book/book/

View File

@ -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"

View File

@ -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(),

View File

@ -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)
}

View File

@ -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();