From 5925525982543655c8704cacc1ec041ee483af03 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 30 Sep 2023 07:58:45 +0300 Subject: [PATCH] fix(datasheet): fails when "bidirectional" is empty e.g. ```yaml documentation: ... # A description of what the inputs do (e.g. red button, SPI CLK, SPI MOSI, etc). inputs: - sclrn - ser - rck - srck - G # A description of what the outputs do (e.g. status LED, SPI MISO, etc) outputs: - q[0] - q[1] - q[2] - q[3] - q[4] - q[5] - q[6] - q[7] # A description of what the bidirectional I/O pins do (e.g. I2C SDA, I2C SCL, etc) bidirectional: ``` --- documentation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation.py b/documentation.py index a04ec2a..038edb3 100644 --- a/documentation.py +++ b/documentation.py @@ -117,6 +117,8 @@ class Docs: # many people remove unused pins in input / output / bidirectional for key in ["inputs", "outputs", "bidirectional"]: + if not yaml_data[key]: + yaml_data[key] = [] yaml_data[key].extend((8 - len(yaml_data[key])) * ["n/a"]) # now build the doc & print it