summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-02-27 20:29:04 +0100
committerHampusM <hampus@hampusmat.com>2023-02-27 20:29:04 +0100
commit8185ac7f4c466eaac178f1e4e8f1d3f7ef1bb49b (patch)
treef3e3abc3e9cb422f577f0370802ad9c95c2e191c /src
parent2df4eb37ecf373d04d5a499f31fef3a190e25164 (diff)
feat: add program listing description part
Diffstat (limited to 'src')
-rw-r--r--src/description.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/description.rs b/src/description.rs
index 7761f7b..e7cb951 100644
--- a/src/description.rs
+++ b/src/description.rs
@@ -88,6 +88,13 @@ impl FromElements for Description
.map(Part::VariableList)
.map_err(Self::Error::InvalidVariableList),
),
+ "programlisting" => Some(Ok(Part::ProgramListing(
+ part_elem
+ .child_elements()
+ .get_first_text_element()
+ .cloned()
+ .unwrap_or_default(),
+ ))),
"title" => None,
name => Some(Err(Self::Error::UnknownPartFound(name.to_string()))),
})
@@ -126,6 +133,9 @@ pub enum Part
/// Variable list.
VariableList(VariableList),
+
+ /// Program listing.
+ ProgramListing(String),
}
/// Reference entry description paragraph.