From 09c57b7938845395d3682f793b5a8551bc61e4f2 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Wed, 6 Sep 2023 09:56:32 +0300 Subject: [PATCH] fix(datasheet): blackslash characters still break the datasheet applied a bruteforce workaround (replace every backslash with `\mbox{\\textbackslash}`) so we can still get the datasheet generated --- documentation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/documentation.py b/documentation.py index 71288fc..054628f 100644 --- a/documentation.py +++ b/documentation.py @@ -95,10 +95,12 @@ class Docs(): else: logging.warning(f"picture {picture_path} not found, skipping") - # ensure there are no LaTeX escape sequences in various fields - for key in ['author', 'description', 'how_it_works', 'how_to_test']: + # ensure there are no LaTeX escape sequences in various fields, and that optional fields are set + for key in ['author', 'description', 'how_it_works', 'how_to_test', 'external_hw', 'clock_hz', 'git_url', 'doc_link']: if key in yaml_data: - yaml_data[key] = yaml_data[key].replace("\\", "\\\\") + yaml_data[key] = str(yaml_data[key]).replace("\\", "\mbox{\\textbackslash}") + else: + yaml_data[key] = "" # now build the doc & print it try: