Skip to content

Commit 68893f7

Browse files
GuillaumeGomezehuss
authored andcommitted
Show where the book was generated
1 parent e8dff6f commit 68893f7

File tree

6 files changed

+11
-1
lines changed

6 files changed

+11
-1
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::sync::LazyLock;
1616

1717
use crate::utils::fs::get_404_output_file;
1818
use handlebars::Handlebars;
19-
use log::{debug, trace, warn};
19+
use log::{debug, info, trace, warn};
2020
use regex::{Captures, Regex};
2121
use serde_json::json;
2222

@@ -482,6 +482,8 @@ impl Renderer for HtmlHandlebars {
482482
// Copy all remaining files, avoid a recursive copy from/to the book build dir
483483
utils::fs::copy_files_except_ext(&src_dir, destination, true, Some(&build_dir), &["md"])?;
484484

485+
info!("HTML book written to `{}`", destination.display());
486+
485487
Ok(())
486488
}
487489
}

tests/testsuite/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fn basic_build() {
1212
cmd.expect_stderr(str![[r#"
1313
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
1414
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
15+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
1516
1617
"#]]);
1718
});

tests/testsuite/includes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ fn recursive_include() {
4848
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
4949
[TIMESTAMP] [ERROR] (mdbook::preprocess::links): Stack depth exceeded in recursive.md. Check for cyclic includes
5050
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
51+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
5152
5253
"#]]);
5354
})

tests/testsuite/markdown.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn footnotes() {
2626
[TIMESTAMP] [WARN] (mdbook::utils): footnote `unused` in `<unknown>` is defined but not referenced
2727
[TIMESTAMP] [WARN] (mdbook::utils): footnote `multiple-definitions` in footnotes.md defined multiple times - not updating to new definition
2828
[TIMESTAMP] [WARN] (mdbook::utils): footnote `unused` in `footnotes.md` is defined but not referenced
29+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
2930
3031
"#]]);
3132
})

tests/testsuite/preprocessor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ fn nop_preprocessor() {
4848
cmd.expect_stdout(str![[""]]).expect_stderr(str![[r#"
4949
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
5050
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
51+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
5152
5253
"#]]);
5354
});

tests/testsuite/theme.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn empty_theme() {
2626
cmd.expect_stderr(str![[r#"
2727
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
2828
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
29+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
2930
3031
"#]]);
3132
});
@@ -149,6 +150,7 @@ fn copy_fonts_false_no_theme() {
149150
[TIMESTAMP] [WARN] (mdbook::renderer::html_handlebars::static_files): output.html.copy-fonts is deprecated.
150151
This book appears to have copy-fonts=false in book.toml without a fonts.css file.
151152
Add an empty `theme/fonts/fonts.css` file to squelch this warning.
153+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
152154
153155
"#]]);
154156
})
@@ -164,6 +166,7 @@ fn copy_fonts_false_with_empty_fonts_css() {
164166
cmd.expect_stderr(str![[r#"
165167
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
166168
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
169+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
167170
168171
"#]]);
169172
})
@@ -179,6 +182,7 @@ fn copy_fonts_false_with_fonts_css() {
179182
cmd.expect_stderr(str![[r#"
180183
[TIMESTAMP] [INFO] (mdbook::book): Book building has started
181184
[TIMESTAMP] [INFO] (mdbook::book): Running the html backend
185+
[TIMESTAMP] [INFO] (mdbook::renderer::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
182186
183187
"#]]);
184188
})

0 commit comments

Comments
 (0)