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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::sync::LazyLock;

use crate::utils::fs::get_404_output_file;
use handlebars::Handlebars;
use log::{debug, trace, warn};
use log::{debug, info, trace, warn};
use regex::{Captures, Regex};
use serde_json::json;

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

Ok(())
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fn basic_build() {
cmd.expect_stderr(str![[r#"
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
});
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/includes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fn recursive_include() {
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
[TIMESTAMP] [ERROR] (mdbook::preprocess::links): Stack depth exceeded in recursive.md. Check for cyclic includes
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
})
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn footnotes() {
[TIMESTAMP] [WARN] (mdbook::utils): footnote `unused` in `<unknown>` is defined but not referenced
[TIMESTAMP] [WARN] (mdbook::utils): footnote `multiple-definitions` in footnotes.md defined multiple times - not updating to new definition
[TIMESTAMP] [WARN] (mdbook::utils): footnote `unused` in `footnotes.md` is defined but not referenced
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
})
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/preprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fn nop_preprocessor() {
cmd.expect_stdout(str![[""]]).expect_stderr(str![[r#"
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
});
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn empty_theme() {
cmd.expect_stderr(str![[r#"
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
});
Expand Down Expand Up @@ -149,6 +150,7 @@ fn copy_fonts_false_no_theme() {
[TIMESTAMP] [WARN] (mdbook::renderer::html_handlebars::static_files): output.html.copy-fonts is deprecated.
This book appears to have copy-fonts=false in book.toml without a fonts.css file.
Add an empty `theme/fonts/fonts.css` file to squelch this warning.
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
})
Expand All @@ -164,6 +166,7 @@ fn copy_fonts_false_with_empty_fonts_css() {
cmd.expect_stderr(str![[r#"
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
})
Expand All @@ -179,6 +182,7 @@ fn copy_fonts_false_with_fonts_css() {
cmd.expect_stderr(str![[r#"
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): Book has been generated into `[ROOT]/book`

"#]]);
})
Expand Down