Skip to content

Show where the book was generated #2729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

It now looks like this:

$ cargo run -- build test_book/
   Compiling mdbook v0.4.51 (/somewhere/mdBook)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.48s
     Running `target/debug/mdbook build test_book/`
2025-06-12 21:33:28 [INFO] (mdbook::book): Book building has started
2025-06-12 21:33:28 [INFO] (mdbook::book): Running the html backend
2025-06-12 21:33:28 [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `/somewhere/mdBook/test_book/book`

It's very convenient to see where the book is actually generated (even more when working on mdbook 😆).

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Jun 12, 2025
@GuillaumeGomez GuillaumeGomez requested a review from ehuss June 13, 2025 11:22
@@ -482,6 +482,8 @@ impl Renderer for HtmlHandlebars {
// Copy all remaining files, avoid a recursive copy from/to the book build dir
utils::fs::copy_files_except_ext(&src_dir, destination, true, Some(&build_dir), &["md"])?;

info!("Book has been generated into `{}`", build_dir.display());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a particular reason to use build_dir instead of destination? It might be confusing, since this is specifically for the HTML renderer, but this is showing the root output directory which might not be where the HTML output actually resides. Maybe something like this?

Suggested change
info!("Book has been generated into `{}`", build_dir.display());
info!("HTML book written to `{}`", destination.display());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason, simply missed that HTML output folder might not be the same as build folder.

@GuillaumeGomez
Copy link
Member Author

Updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: waiting on a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants