Skip to content

Commit 0eb23ef

Browse files
committed
Make page-break not configurable
1 parent e78a847 commit 0eb23ef

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

guide/src/format/config.md

-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ Available configuration options for the `[output.html.print]` table:
224224

225225
- **enable:** Enable print support. When `false`, all print support will not be
226226
rendered. Defaults to `true`.
227-
- **page-break** Insert page breaks between chapters. Defaults to `true`.
228227

229228
Available configuration options for the `[output.html.fold]` table:
230229

@@ -293,7 +292,6 @@ input-404 = "not-found.md"
293292

294293
[output.html.print]
295294
enable = true
296-
page-break = true
297295

298296
[output.html.fold]
299297
enable = false

src/config.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -580,16 +580,11 @@ impl HtmlConfig {
580580
pub struct Print {
581581
/// Whether print support is enabled.
582582
pub enable: bool,
583-
/// Insert page breaks between chapters. Default: `true`.
584-
pub page_break: bool,
585583
}
586584

587585
impl Default for Print {
588586
fn default() -> Self {
589-
Self {
590-
enable: true,
591-
page_break: true,
592-
}
587+
Self { enable: true }
593588
}
594589
}
595590

src/renderer/html_handlebars/hbs_renderer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl HtmlHandlebars {
4545
ctx.html_config.curly_quotes,
4646
Some(&path),
4747
);
48-
if !ctx.is_index && ctx.html_config.print.page_break {
48+
if !ctx.is_index {
4949
// Add page break between chapters
5050
// 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
5151
// Add both two CSS properties because of the compatibility issue

0 commit comments

Comments
 (0)