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
```
This commit is contained in:
Uri Shaked
2023-09-05 10:13:21 +03:00
parent dac3f4a0a4
commit ae0f2483ba
+5
View File
@@ -95,6 +95,11 @@ class Docs():
else: else:
logging.warning(f"picture {picture_path} not found, skipping") 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 # now build the doc & print it
try: try:
doc = doc_template.format(**yaml_data) doc = doc_template.format(**yaml_data)