From 792657a68439e041e9072190beb49ddf60482a74 Mon Sep 17 00:00:00 2001 From: wuyangfan <1102042793@qq.com> Date: Sun, 17 May 2026 12:23:08 +0800 Subject: [PATCH] docs: document print.html output and reserved print.md Clarifies that the print button opens auto-generated print.html and that src/print.md must not be used as a chapter. Fixes #3088. Co-authored-by: Cursor --- guide/src/format/configuration/renderers.md | 10 ++++++++++ guide/src/guide/reading.md | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/guide/src/format/configuration/renderers.md b/guide/src/format/configuration/renderers.md index 22dfd425fb..a217d97f03 100644 --- a/guide/src/format/configuration/renderers.md +++ b/guide/src/format/configuration/renderers.md @@ -188,6 +188,16 @@ page-break = true # insert page-break after each chapter rendered. Defaults to `true`. - **page-break:** Insert page breaks between chapters. Defaults to `true`. +#### `print.html` and `print.md` + +When print support is enabled, mdBook writes **`print.html`** to the book output directory. +This file contains the entire book on a single page. +The print icon in the menu bar (see [Reading a book](../../guide/reading.md)) opens this file for printing. + +**`print.md` is reserved** for internal use. +Do not create `src/print.md` or add it to `SUMMARY.md`. +If you do, the build fails with the error `print.md is reserved for internal use`. + ### `[output.html.fold]` The `[output.html.fold]` table provides options for controlling folding of the chapter listing in the navigation sidebar. diff --git a/guide/src/guide/reading.md b/guide/src/guide/reading.md index 64624bd300..79d4c3fb52 100644 --- a/guide/src/guide/reading.md +++ b/guide/src/guide/reading.md @@ -33,7 +33,7 @@ The icons displayed will depend on the settings of how the book was generated. | | Opens and closes the chapter listing sidebar. | | | Opens a picker to choose a different color theme. | | | Opens a search bar for searching within the book. | -| | Instructs the web browser to print the entire book. | +| | Opens **print.html**, which contains the entire book on one page for printing. | | | Opens a link to the website that hosts the source code of the book. | | | Opens a page to directly edit the source of the page you are currently reading. |