From ae254b774e4ca71de86db3533c720f39d4ec72aa Mon Sep 17 00:00:00 2001 From: mole99 Date: Wed, 21 Aug 2024 08:45:26 +0200 Subject: [PATCH] Do not add broken links to the documentation --- Changelog.md | 6 ++++++ cace/__version__.py | 2 +- cace/common/cace_write.py | 18 ++++++++++-------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Changelog.md b/Changelog.md index b5e07eb..8ac8f6a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +# 2.4.10 + +## Common + +- Fix: Do not include broken links in the documentation if no layout is available + # 2.4.9 ## Common diff --git a/cace/__version__.py b/cace/__version__.py index e3fff8c..d90cb1f 100644 --- a/cace/__version__.py +++ b/cace/__version__.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -__version__ = '2.4.9' +__version__ = '2.4.10' if __name__ == '__main__': print(__version__, end='') diff --git a/cace/common/cace_write.py b/cace/common/cace_write.py index a40d88a..d47f6cf 100755 --- a/cace/common/cace_write.py +++ b/cace/common/cace_write.py @@ -157,14 +157,16 @@ def generate_documentation(datasheet): f'![Schematic of {datasheet["name"]}]({datasheet["name"]}_schematic.svg)\n' ) - # Add layout images - ofile.write(f'\n## Layout\n\n') - ofile.write( - f'![Layout of {datasheet["name"]} with white background]({datasheet["name"]}_w.png)\n' - ) - ofile.write( - f'![Layout of {datasheet["name"]} with black background]({datasheet["name"]}_b.png)\n' - ) + if 'layout' in datasheet['paths']: + + # Add layout images + ofile.write(f'\n## Layout\n\n') + ofile.write( + f'![Layout of {datasheet["name"]} with white background]({datasheet["name"]}_w.png)\n' + ) + ofile.write( + f'![Layout of {datasheet["name"]} with black background]({datasheet["name"]}_b.png)\n' + ) # Generate xschem symbol svg svgpath = os.path.join(