tramlines-md 0.5.0

Checks markdown documents against a schema, and derives the scaffold a schema implies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! The scaffold writes the message of each ban after the guidance of the
//! part that the ban governs, so that a writer reads every rule before
//! writing, and not only after breaking it (`TLMD_195`). The bans of a block
//! are the guide's, in `guide.rs`.

use super::Deriver;

impl Deriver<'_> {
    /// `schema_bans` returns the messages of the bans of the whole body.
    pub(super) fn schema_bans(&self) -> Vec<String> {
        self.schema
            .core
            .prohibited_patterns
            .iter()
            .map(|b| b.message.clone())
            .collect()
    }
}