acdc-parser 0.8.0

`AsciiDoc` parser using PEG grammars
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{AttributeValue, DocumentAttributes};

/// Check if the document has doctype=manpage.
pub fn is_manpage_doctype(attrs: &DocumentAttributes) -> bool {
    attrs
        .get("doctype")
        .is_some_and(|v| matches!(v, AttributeValue::String(s) if s == "manpage"))
}

/// Check if the document has doctype=book.
pub fn is_book_doctype(attrs: &DocumentAttributes) -> bool {
    attrs
        .get("doctype")
        .is_some_and(|v| matches!(v, AttributeValue::String(s) if s == "book"))
}