Skip to content

Commit

Permalink
Merge pull request #2328 from ehuss/clarify-src-path
Browse files Browse the repository at this point in the history
Clarify Chapter path and source_path.
  • Loading branch information
ehuss authored Feb 25, 2024
2 parents c602a2f + 5f5f9d6 commit 5a35144
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/book/book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,20 @@ pub struct Chapter {
/// Nested items.
pub sub_items: Vec<BookItem>,
/// 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<PathBuf>,
/// 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<PathBuf>,
/// An ordered list of the names of each chapter above this one in the hierarchy.
pub parent_names: Vec<String>,
Expand Down

0 comments on commit 5a35144

Please sign in to comment.