MkDocsPattern

Trait MkDocsPattern 

Source
pub trait MkDocsPattern: Send + Sync {
    // Required methods
    fn is_marker(&self, line: &str) -> bool;
    fn get_indent(&self, line: &str) -> Option<usize>;
    fn is_content(&self, line: &str, base_indent: usize) -> bool;
    fn is_within_context(&self, content: &str, position: usize) -> bool;
    fn name(&self) -> &'static str;
}
Expand description

Trait for MkDocs pattern detection implementations All MkDocs features should implement this trait for consistency

Required Methods§

Source

fn is_marker(&self, line: &str) -> bool

Check if a line matches the pattern’s start marker

Source

fn get_indent(&self, line: &str) -> Option<usize>

Get the base indentation level of a marker line

Source

fn is_content(&self, line: &str, base_indent: usize) -> bool

Check if a line is part of the pattern’s content area

Source

fn is_within_context(&self, content: &str, position: usize) -> bool

Check if a byte position is within this pattern’s context

Source

fn name(&self) -> &'static str

Get a descriptive name for this pattern (for debugging)

Implementors§