Skip to content

Commit

Permalink
chore(docs): update example books (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-heller authored Sep 14, 2024
1 parent 4b68d19 commit 3b8c839
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 122 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ tracing-subscriber = { version = "0.3.0", default-features = false, features = [
insta.opt-level = 3
similar.opt-level = 3

[workspace]
exclude = ["books/rust-reference/mdbook-spec"]

# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
Expand Down
2 changes: 1 addition & 1 deletion books/cargo
Submodule cargo updated 865 files
2 changes: 1 addition & 1 deletion books/mdBook
2 changes: 1 addition & 1 deletion books/nomicon
2 changes: 1 addition & 1 deletion books/rust-book
Submodule rust-book updated 71 files
+7 −7 .github/workflows/main.yml
+10 −0 ADMIN_TASKS.md
+10 −0 README.md
+3 −0 book.toml
+7 −1 listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
+6 −4 listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt
+4 −4 listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt
+2 −2 listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt
+8 −0 listings/ch09-error-handling/listing-09-10/output.txt
+1 −1 listings/ch13-functional-features/listing-13-04/output.txt
+1 −1 listings/ch13-functional-features/listing-13-05/output.txt
+1 −1 listings/ch15-smart-pointers/listing-15-21/output.txt
+1 −1 listings/ch16-fearless-concurrency/listing-16-14/output.txt
+2 −2 listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt
+1 −1 listings/ch20-web-server/listing-20-02/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-03/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-05/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-06/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-07/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-09/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-10/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-11/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-12/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-13/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-14/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-15/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-16/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-17/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-18/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-19/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-20/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-21/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-22/output.txt
+1 −1 listings/ch20-web-server/listing-20-22/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-23/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-24/src/main.rs
+1 −1 listings/ch20-web-server/listing-20-25/src/main.rs
+1 −1 listings/ch20-web-server/no-listing-01-define-threadpool-struct/src/main.rs
+1 −1 listings/ch20-web-server/no-listing-02-impl-threadpool-new/src/main.rs
+1 −1 listings/ch20-web-server/no-listing-03-define-execute/src/main.rs
+1 −1 listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt
+1 −1 listings/ch20-web-server/no-listing-04-update-worker-definition/src/main.rs
+1 −1 listings/ch20-web-server/no-listing-05-fix-worker-new/src/main.rs
+1 −1 listings/ch20-web-server/no-listing-06-fix-threadpool-drop/src/main.rs
+1 −1 listings/ch20-web-server/no-listing-07-final-code/src/main.rs
+66 −69 nostarch/chapter07.md
+375 −308 nostarch/chapter12.md
+16 −7 packages/mdbook-trpl-listing/Cargo.lock
+1 −1 packages/mdbook-trpl-listing/Cargo.toml
+156 −514 packages/mdbook-trpl-listing/src/lib.rs
+242 −0 packages/mdbook-trpl-listing/src/tests/config.rs
+192 −0 packages/mdbook-trpl-listing/src/tests/mod.rs
+1 −1 packages/mdbook-trpl-note/src/lib.rs
+7 −21 packages/tools/src/bin/link2print.rs
+56 −8 packages/tools/src/bin/release_listings.rs
+1 −1 rust-toolchain
+2 −1 src/ch01-03-hello-cargo.md
+2 −1 src/ch03-03-how-functions-work.md
+1 −1 src/ch03-05-control-flow.md
+4 −7 src/ch07-01-packages-and-crates.md
+7 −9 src/ch12-00-an-io-project.md
+8 −8 src/ch12-01-accepting-command-line-arguments.md
+8 −7 src/ch12-02-reading-a-file.md
+30 −31 src/ch12-03-improving-error-handling-and-modularity.md
+27 −27 src/ch12-04-testing-the-librarys-functionality.md
+23 −23 src/ch12-05-working-with-environment-variables.md
+5 −4 src/ch12-06-writing-to-stderr-instead-of-stdout.md
+2 −2 src/ch20-01-single-threaded.md
+1 −1 src/title-page.md
+6 −0 tools/generate-preview.sh
+2 −0 tools/preview-robots.txt
2 changes: 1 addition & 1 deletion books/rust-embedded
2 changes: 1 addition & 1 deletion books/rust-reference
Submodule rust-reference updated 86 files
+81 −16 .github/workflows/main.yml
+13 −8 README.md
+4 −0 book.toml
+10 −1 docs/authoring.md
+47 −0 docs/review-policy.md
+1 −0 mdbook-spec/.gitignore
+13 −0 mdbook-spec/CHANGELOG.md
+989 −0 mdbook-spec/Cargo.lock
+21 −0 mdbook-spec/Cargo.toml
+176 −0 mdbook-spec/LICENSE-APACHE
+25 −0 mdbook-spec/LICENSE-MIT
+5 −0 mdbook-spec/README.md
+192 −0 mdbook-spec/src/lib.rs
+21 −0 mdbook-spec/src/main.rs
+336 −0 mdbook-spec/src/std_links.rs
+18 −3 src/abi.md
+14 −2 src/attributes.md
+11 −11 src/attributes/codegen.md
+0 −2 src/attributes/derive.md
+0 −1 src/attributes/diagnostics.md
+5 −1 src/attributes/limits.md
+3 −3 src/attributes/testing.md
+28 −5 src/attributes/type_system.md
+61 −51 src/behavior-considered-undefined.md
+14 −37 src/conditional-compilation.md
+7 −23 src/const_eval.md
+4 −4 src/crates-and-source-files.md
+64 −6 src/destructors.md
+2 −3 src/expressions.md
+2 −2 src/expressions/array-expr.md
+8 −8 src/expressions/await-expr.md
+2 −3 src/expressions/block-expr.md
+2 −5 src/expressions/call-expr.md
+1 −8 src/expressions/literal-expr.md
+2 −0 src/expressions/loop-expr.md
+7 −10 src/expressions/method-call-expr.md
+23 −32 src/expressions/operator-expr.md
+169 −9 src/inline-assembly.md
+0 −3 src/input-format.md
+0 −5 src/interior-mutability.md
+17 −15 src/introduction.md
+1 −1 src/items/associated-items.md
+3 −0 src/items/constant-items.md
+42 −11 src/items/enumerations.md
+4 −5 src/items/extern-crates.md
+39 −44 src/items/external-blocks.md
+19 −7 src/items/functions.md
+6 −7 src/items/generics.md
+5 −5 src/items/modules.md
+27 −11 src/items/static-items.md
+16 −12 src/items/structs.md
+4 −0 src/items/traits.md
+5 −5 src/items/type-aliases.md
+4 −4 src/items/unions.md
+257 −57 src/items/use-declarations.md
+4 −1 src/keywords.md
+10 −0 src/linkage.md
+3 −3 src/macros-by-example.md
+0 −5 src/names/namespaces.md
+5 −23 src/names/preludes.md
+1 −1 src/names/scopes.md
+43 −14 src/paths.md
+5 −9 src/patterns.md
+12 −8 src/procedural-macros.md
+3 −3 src/runtime.md
+10 −21 src/special-types-and-traits.md
+6 −4 src/tokens.md
+23 −3 src/trait-bounds.md
+3 −3 src/type-coercions.md
+16 −31 src/type-layout.md
+0 −1 src/types/array.md
+1 −2 src/types/boolean.md
+0 −3 src/types/closure.md
+1 −1 src/types/enum.md
+0 −3 src/types/function-item.md
+30 −3 src/types/impl-trait.md
+2 −2 src/types/never.md
+1 −3 src/types/pointer.md
+3 −3 src/types/textual.md
+2 −2 src/types/trait-object.md
+0 −1 src/types/union.md
+15 −3 src/unsafe-keyword.md
+4 −0 src/unsafety.md
+4 −3 src/visibility-and-privacy.md
+7 −17 style-check/src/main.rs
+20 −37 theme/reference.css
2 changes: 1 addition & 1 deletion books/rustc-dev-guide
Submodule rustc-dev-guide updated 56 files
+5 −1 book.toml
+8 −2 ci/linkcheck.sh
+4 −3 src/SUMMARY.md
+2 −1 src/appendix/background.md
+2 −2 src/appendix/bibliography.md
+1 −1 src/appendix/code-index.md
+0 −1 src/ast-validation.md
+4 −4 src/backend/implicit-caller-location.md
+77 −29 src/backend/updating-llvm.md
+4 −4 src/borrow_check/opaque-types-region-inference-restrictions.md
+1 −1 src/building/suggested.md
+2 −2 src/closure.md
+95 −0 src/coherence.md
+68 −30 src/compiler-debugging.md
+10 −9 src/contributing.md
+1 −1 src/diagnostics/error-guaranteed.md
+1 −1 src/licenses.md
+16 −63 src/llvm-coverage-instrumentation.md
+2 −1 src/memory.md
+1 −1 src/mir/construction.md
+6 −4 src/mir/dataflow.md
+1 −1 src/mir/drop-elaboration.md
+2 −2 src/mir/index.md
+2 −2 src/mir/optimizations.md
+149 −67 src/mir/passes.md
+4 −3 src/mir/visitor.md
+2 −2 src/opaque-types-impl-trait-inference.md
+2 −2 src/overview.md
+6 −6 src/param_env/param_env_acquisition.md
+2 −2 src/param_env/param_env_construction_internals.md
+4 −3 src/profile-guided-optimization.md
+4 −2 src/queries/incremental-compilation-in-detail.md
+14 −0 src/queries/incremental-compilation.md
+3 −3 src/queries/query-evaluation-model-in-detail.md
+2 −2 src/sanitizers.md
+2 −2 src/solve/caching.md
+2 −0 src/solve/invariants.md
+1 −1 src/solve/normalization.md
+5 −4 src/solve/opaque-types.md
+3 −3 src/solve/significant-changes.md
+3 −3 src/solve/trait-solving.md
+5 −5 src/stability.md
+6 −6 src/stabilization_guide.md
+2 −2 src/tests/adding.md
+2 −2 src/tests/ci.md
+0 −2 src/tests/compiletest.md
+2 −2 src/tests/headers.md
+1 −1 src/tests/intro.md
+5 −5 src/tests/running.md
+13 −0 src/tests/ui.md
+2 −2 src/traits/specialization.md
+1 −1 src/ty-fold.md
+2 −2 src/ty_module/binders.md
+4 −4 src/ty_module/early_binder.md
+3 −3 src/ty_module/instantiating_binders.md
+1 −1 src/walkthrough.md
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ mod tests {
pub fn build(mut self) -> BuildOutput {
let mut renderer = Renderer::new();
renderer.logfile = Some(self.logfile.try_clone().unwrap());
env::set_current_dir(&self.book.root).unwrap();
let res = self.book.execute_build_process(&renderer);
self.logfile.seek(io::SeekFrom::Start(0)).unwrap();
let mut logs = String::new();
Expand Down
6 changes: 6 additions & 0 deletions src/snapshots/mdbook_pandoc__tests__cargo_book.snap
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,11 @@ DEBUG mdbook_pandoc::pandoc::renderer: Running pandoc
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__commands__cargo-buildmd__option-cargo-build---keep-going'
on $PAGE undefined on input $LINE.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__commands__cargomd__option-cargo---offline'
on $PAGE undefined on input $LINE.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pdf__src__commands__cargomd__option-cargo---frozen'
on $PAGE undefined on input $LINE.
[WARNING] [makePDF] LaTeX Warning: There were undefined references.
INFO mdbook_pandoc::pandoc::renderer: Wrote output to book/pdf/book.pdf
31 changes: 28 additions & 3 deletions src/snapshots/mdbook_pandoc__tests__rust_edition_guide.snap

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions src/snapshots/mdbook_pandoc__tests__rust_reference.snap

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/snapshots/mdbook_pandoc__tests__rustc_dev_guide.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ expression: logs
WARN mdbook::preprocess::cmd: Command: mdbook-toc
INFO mdbook::book: Running the pandoc backend
INFO mdbook_pandoc: Processing redirects in [output.html.redirect]
INFO mdbook_pandoc::preprocess: Failed to resolve link '../toolstate.md' in chapter 'tests/ci.md', linking to hosted HTML book at 'https://rustc-dev-guide.rust-lang.org/tests/../toolstate.md'
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Coinduction
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Coinduction
INFO mdbook_pandoc::preprocess: Failed to resolve link 'placeholder-ck' in chapter 'solve/opaque-types.md', linking to hosted HTML book at 'https://rustc-dev-guide.rust-lang.org/solve/placeholder-ck'
INFO mdbook_pandoc::preprocess: Failed to resolve link './specialization.md' in chapter 'coherence.md', linking to hosted HTML book at 'https://rustc-dev-guide.rust-lang.org/./specialization.md'
INFO mdbook_pandoc::preprocess: Failed to resolve link './specialization.md' in chapter 'coherence.md', linking to hosted HTML book at 'https://rustc-dev-guide.rust-lang.org/./specialization.md'
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Return Position Impl Trait In Trait
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Return Position Impl Trait In Trait
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Return Position Impl Trait In Trait
Expand All @@ -23,14 +23,16 @@ expression: logs
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Return Position Impl Trait In Trait
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Return Position Impl Trait In Trait
WARN mdbook_pandoc::preprocess: Heading (level h5) converted to paragraph in chapter: Return Position Impl Trait In Trait
INFO mdbook_pandoc::preprocess: Failed to resolve link '../generics.md' in chapter 'appendix/background.md', linking to hosted HTML book at 'https://rustc-dev-guide.rust-lang.org/appendix/../generics.md'
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pandoc__pdf__src__appendix__glossarymd__ice' on $PAGE undefined on input $LINE.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pandoc__pdf__src__conventionsmd__formatting' on $PAGE undefined on input $LINE.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pandoc__pdf__src__tests__addingmd__explanatory_comment'
on $PAGE undefined on input $LINE.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pandoc__pdf__src__compiler-debuggingmd__rustc_-attributes'
on $PAGE undefined on input $LINE.
[WARNING] [makePDF] LaTeX Warning: Hyper reference
`book__pandoc__pdf__src__building__how-to-build-and-runmd__toolchain'
on $PAGE undefined on input $LINE.
Expand Down

0 comments on commit 3b8c839

Please sign in to comment.