mdbook-journal 0.4.0

journal plugin for mdBook
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

pub trait BookItemExtension {
    fn section_number(&self) -> Option<&SectionNumber>;
}

impl BookItemExtension for BookItem {
    fn section_number(&self) -> Option<&SectionNumber> {
        match self {
            Self::Chapter(Chapter {
                number: Some(section),
                ..
            }) => Some(section),
            _ => None,
        }
    }
}