File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -160,8 +160,20 @@ pub struct Chapter {
160160 /// Nested items.
161161 pub sub_items : Vec < BookItem > ,
162162 /// The chapter's location, relative to the `SUMMARY.md` file.
163+ ///
164+ /// **Note**: After the index preprocessor runs, any README files will be
165+ /// modified to be `index.md`. If you need access to the actual filename
166+ /// on disk, use [`Chapter::source_path`] instead.
167+ ///
168+ /// This is `None` for a draft chapter.
163169 pub path : Option < PathBuf > ,
164170 /// The chapter's source file, relative to the `SUMMARY.md` file.
171+ ///
172+ /// **Note**: Beware that README files will internally be treated as
173+ /// `index.md` via the [`Chapter::path`] field. The `source_path` field
174+ /// exists if you need access to the true file path.
175+ ///
176+ /// This is `None` for a draft chapter.
165177 pub source_path : Option < PathBuf > ,
166178 /// An ordered list of the names of each chapter above this one in the hierarchy.
167179 pub parent_names : Vec < String > ,
You can’t perform that action at this time.
0 commit comments