mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
Merge pull request #26 from htfab/tt04
Allow svg and pdf images in the datasheet
This commit is contained in:
+1
-4
@@ -85,10 +85,7 @@ class Docs():
|
||||
if yaml_data['picture']:
|
||||
extension = os.path.splitext(yaml_data['picture'])[1]
|
||||
picture_path = os.path.join(project.local_dir, f"picture{extension}")
|
||||
if extension == '.svg':
|
||||
# SVGs are not supported by pandoc
|
||||
logging.warning(f"Skipping unsupported SVG picture {picture_path}")
|
||||
elif os.path.exists(picture_path):
|
||||
if os.path.exists(picture_path):
|
||||
yaml_data['picture_link'] = latex_centered_image(picture_path)
|
||||
else:
|
||||
logging.warning(f"picture {picture_path} not found, skipping")
|
||||
|
||||
+2
-6
@@ -381,7 +381,7 @@ class Project():
|
||||
if not picture:
|
||||
return
|
||||
extension = os.path.splitext(picture)[1]
|
||||
supported_extensions = ['.png', '.jpg', '.jpeg', '.svg']
|
||||
supported_extensions = ['.png', '.jpg', '.jpeg', '.svg', '.pdf']
|
||||
if not os.path.exists(picture):
|
||||
logging.warning(f"Picture file '{picture}' not found in repo, skipping")
|
||||
elif extension not in supported_extensions:
|
||||
@@ -462,12 +462,8 @@ class Project():
|
||||
# handle pictures
|
||||
yaml['picture_link'] = ''
|
||||
if yaml['picture']:
|
||||
# skip SVG for now, not supported by pandoc
|
||||
picture_name = yaml['picture']
|
||||
if 'svg' not in picture_name:
|
||||
yaml['picture_link'] = ''.format(picture_name)
|
||||
else:
|
||||
logging.warning("svg not supported")
|
||||
yaml['picture_link'] = ''.format(picture_name)
|
||||
|
||||
# now build the doc & print it
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user