Skip to content

Commit da297e5

Browse files
committed
feat(flake-info): literalMD parsing
1 parent 4dc33c5 commit da297e5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

flake-info/src/data/import.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub enum ModulePath {
8787
#[serde(untagged)]
8888
pub enum DocString {
8989
DocFormat(DocFormat),
90+
Literal(Literal),
9091
String(String),
9192
}
9293

@@ -126,6 +127,19 @@ impl Serialize for DocString {
126127
warn!("Could not render Markdown content: {}", e);
127128
md.to_owned()
128129
})),
130+
DocString::Literal(Literal::LiteralExpression(s)) => serializer.serialize_str(&s),
131+
DocString::Literal(Literal::LiteralDocBook(db)) => {
132+
serializer.serialize_str(&db.render_docbook().unwrap_or_else(|e| {
133+
warn!("Could not render DocBook content: {}", e);
134+
db.to_owned()
135+
}))
136+
}
137+
DocString::Literal(Literal::LiteralMarkdown(md)) => {
138+
serializer.serialize_str(&md.render_markdown().unwrap_or_else(|e| {
139+
warn!("Could not render Markdown content: {}", e);
140+
md.to_owned()
141+
}))
142+
}
129143
}
130144
}
131145
}

0 commit comments

Comments
 (0)