Add array examples

This commit is contained in:
Pierre HUBERT 2023-02-07 14:52:30 +01:00
parent c56760927c
commit 3eeeac6841

View File

@ -143,9 +143,12 @@ fn tex_export_inner(tree: &ObjectChild, out: &mut String, required: bool) {
None => "".to_string(), None => "".to_string(),
Some(d) => tex_escape_str(d), Some(d) => tex_escape_str(d),
}, },
match tree.node.examples.get(0) { match (&tree.node.r#type, tree.node.examples.get(0)) {
None => "".to_string(), (_, Some(e)) => tex_escape_str(e),
Some(e) => tex_escape_str(e), (NodeType::Array { item }, _) if !item.examples.is_empty() => {
format!("[{}]", &item.examples.get(0).unwrap())
}
_ => "".to_string(),
} }
) )
.unwrap(); .unwrap();