Add object name in jsonsample environment

This commit is contained in:
2023-03-01 14:38:48 +01:00
parent 536125a4f4
commit d6d0b10537
3 changed files with 6 additions and 3 deletions

View File

@ -208,7 +208,10 @@ fn tex_export(tree: &TreeNode) -> String {
// JSON export
out.push_str(&format!("\\newsavebox{{{box_name}}}\n"));
out.push_str(&format!("\\begin{{lrbox}}{{{box_name}}}\n"));
out.push_str("\\begin{jsonsample}\n");
out.push_str(&format!(
"\\begin{{jsonsample}}{{{}}}\n",
tex_escape_str(&tree.name)
));
out.push_str("\\begin{lstlisting}[language=json]\n");
let json_doc = serde_json::to_string_pretty(&tree.example_value(1)).unwrap();
let replace_key = serde_json::to_string(REF_OBJECT).unwrap();