Make page-break not configurable

This commit is contained in:
Evian-Zhang 2021-03-16 09:33:19 +08:00
parent e78a8471c7
commit 0eb23efd44
3 changed files with 2 additions and 9 deletions

View File

@ -224,7 +224,6 @@ Available configuration options for the `[output.html.print]` table:
- **enable:** Enable print support. When `false`, all print support will not be - **enable:** Enable print support. When `false`, all print support will not be
rendered. Defaults to `true`. rendered. Defaults to `true`.
- **page-break** Insert page breaks between chapters. Defaults to `true`.
Available configuration options for the `[output.html.fold]` table: Available configuration options for the `[output.html.fold]` table:
@ -293,7 +292,6 @@ input-404 = "not-found.md"
[output.html.print] [output.html.print]
enable = true enable = true
page-break = true
[output.html.fold] [output.html.fold]
enable = false enable = false

View File

@ -580,16 +580,11 @@ impl HtmlConfig {
pub struct Print { pub struct Print {
/// Whether print support is enabled. /// Whether print support is enabled.
pub enable: bool, pub enable: bool,
/// Insert page breaks between chapters. Default: `true`.
pub page_break: bool,
} }
impl Default for Print { impl Default for Print {
fn default() -> Self { fn default() -> Self {
Self { Self { enable: true }
enable: true,
page_break: true,
}
} }
} }

View File

@ -45,7 +45,7 @@ impl HtmlHandlebars {
ctx.html_config.curly_quotes, ctx.html_config.curly_quotes,
Some(&path), Some(&path),
); );
if !ctx.is_index && ctx.html_config.print.page_break { if !ctx.is_index {
// Add page break between chapters // Add page break between chapters
// See https://developer.mozilla.org/en-US/docs/Web/CSS/break-before and https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-before // See https://developer.mozilla.org/en-US/docs/Web/CSS/break-before and https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-before
// Add both two CSS properties because of the compatibility issue // Add both two CSS properties because of the compatibility issue