From ae0f2483ba07b23a93c1c06dcf463c28201a0dce Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Tue, 5 Sep 2023 10:13:21 +0300 Subject: [PATCH] fix(datasheet): backslash characters in project description break the datasheet e.g. the "description" field of the following info.yaml would break the datasheet generation: ```yaml documentation: author: "Sarthak Raheja and Bittu N" # Your name title: "Simple Piano" # Project title language: "Verilog" # other examples include Verilog, Amaranth, VHDL, etc # Short description of what your project does description: | The input clock is divided into a series of frequencies to mimic a piano having only 12 keys of one octave. User can choose from a choice of 3-5 octaves. Additionally, few pre-defined tunes have been included using RTTTL logic\n ``` --- documentation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation.py b/documentation.py index cc7374d..71288fc 100644 --- a/documentation.py +++ b/documentation.py @@ -95,6 +95,11 @@ 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']: + if key in yaml_data: + yaml_data[key] = yaml_data[key].replace("\\", "\\\\") + # now build the doc & print it try: doc = doc_template.format(**yaml_data)