Add basic support for panels and code block in jiradoc
This commit is contained in:
parent
fa387c5546
commit
dcc8882740
2 changed files with 21 additions and 1 deletions
|
@ -33,15 +33,34 @@ fn render_doc_node(f: &mut String, node: &DocNode) -> Result<(), Box<dyn std::er
|
|||
writeln!(f, "---")?;
|
||||
}
|
||||
DocNode::Heading(x) => {
|
||||
writeln!(f)?;
|
||||
write!(f, "## ")?;
|
||||
for node in x {
|
||||
render_text_node(f, node)?;
|
||||
}
|
||||
writeln!(f)?;
|
||||
writeln!(f)?;
|
||||
}
|
||||
DocNode::MediaSingle(x) => {
|
||||
for node in x {
|
||||
render_text_markets(f, node)?;
|
||||
}
|
||||
}
|
||||
DocNode::Panel(x) => {
|
||||
writeln!(f, "┌{:─<79}", "")?;
|
||||
for node in x {
|
||||
render_doc_node(f, node)?;
|
||||
}
|
||||
writeln!(f, "└{:─<79}", "")?;
|
||||
}
|
||||
DocNode::CodeBlock(x) => {
|
||||
writeln!(f, "┌---------------")?;
|
||||
for node in x {
|
||||
render_text_node(f, node)?;
|
||||
}
|
||||
writeln!(f)?;
|
||||
writeln!(f, "└---------------")?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -17,6 +17,8 @@ pub enum DocNode {
|
|||
Rule,
|
||||
Heading(Vec<DocTextNode>),
|
||||
MediaSingle(Vec<DocTextMarker>),
|
||||
Panel(Vec<DocNode>),
|
||||
CodeBlock(Vec<DocTextNode>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
|
@ -86,5 +88,4 @@ pub struct DocMention {
|
|||
pub struct DocMentionAttrs {
|
||||
pub id: String,
|
||||
pub text: String,
|
||||
pub local_id: String,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue