| 22 | /// A parsed directive block. |
| 23 | #[derive(Debug, Clone, PartialEq)] |
| 24 | pub struct Directive { |
| 25 | pub name: String, |
| 26 | pub id: Option<String>, |
| 27 | pub attrs: BTreeMap<String, String>, |
| 28 | /// Prose inside a container directive (trimmed). Empty for leaf directives. |
| 29 | pub body: String, |
| 30 | /// The `[label]` of an inline directive. `None` for container/leaf forms. |
| 31 | pub label: Option<String>, |
| 32 | /// Leaf and inline directives nested inside this container. |
| 33 | pub children: Vec<Directive>, |
| 34 | } |
| 35 | |
| 36 | impl Directive { |
| 37 | pub fn attr(&self, key: &str) -> Option<&str> { |
no outgoing calls
no test coverage detected