From 5f5f9d6fd5de28f38035473d25e9780fcb3f2238 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 25 Feb 2024 15:20:19 -0800 Subject: [PATCH] Clarify Chapter path and source_path. --- src/book/book.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/book/book.rs b/src/book/book.rs index 39d58aed..f08350c2 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -160,8 +160,20 @@ pub struct Chapter { /// Nested items. pub sub_items: Vec, /// The chapter's location, relative to the `SUMMARY.md` file. + /// + /// **Note**: After the index preprocessor runs, any README files will be + /// modified to be `index.md`. If you need access to the actual filename + /// on disk, use [`Chapter::source_path`] instead. + /// + /// This is `None` for a draft chapter. pub path: Option, /// The chapter's source file, relative to the `SUMMARY.md` file. + /// + /// **Note**: Beware that README files will internally be treated as + /// `index.md` via the [`Chapter::path`] field. The `source_path` field + /// exists if you need access to the true file path. + /// + /// This is `None` for a draft chapter. pub source_path: Option, /// An ordered list of the names of each chapter above this one in the hierarchy. pub parent_names: Vec,