From 8185ac7f4c466eaac178f1e4e8f1d3f7ef1bb49b Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 27 Feb 2023 20:29:04 +0100 Subject: feat: add program listing description part --- src/description.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- cgit v1.2.3-18-g5258