aboutsummaryrefslogtreecommitdiffstats
path: root/doc/helpers.py
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2022-02-07 17:52:26 +0100
committerumarcor <unai.martinezcorral@ehu.eus>2022-02-07 18:41:31 +0100
commitd275c83869d154f2f6529f1e64391f90de9ee64b (patch)
tree89a36b39abd471fdd77823345663949993907293 /doc/helpers.py
parent6f972aaf43085c362239e3980a26868df18c2fd8 (diff)
downloadghdl-d275c83869d154f2f6529f1e64391f90de9ee64b.tar.gz
ghdl-d275c83869d154f2f6529f1e64391f90de9ee64b.tar.bz2
ghdl-d275c83869d154f2f6529f1e64391f90de9ee64b.zip
doc: use theme_overrides and class 'shield' to fix the width of SHIELDs
Diffstat (limited to 'doc/helpers.py')
-rw-r--r--doc/helpers.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/doc/helpers.py b/doc/helpers.py
index 9baddf700..5d099e729 100644
--- a/doc/helpers.py
+++ b/doc/helpers.py
@@ -26,13 +26,19 @@ def printShieldSrc(label, alt, img, target, latex=False):
if latex:
if label[-6:] == '/total':
label = label[:-6]
- print('.. |l' + re.compile('[\W_]+').sub('', label) + '| replace:: `' + label + '`_')
- print('.. _' + label + ': ' + target + '\n')
+ idx = re.compile('[\W_]+').sub('', label)
+ print(f"""
+.. |l{idx}| replace:: `{label}`_
+.. _{label}: {target}
+""")
else:
- print('.. |' + label + '| image:: '+ img + '\n',
- ' :target: ' + target + '\n',
- ' :height: 22\n',
- ' :alt: ' + alt + '\n')
+ print(f'''
+.. |{label}| image:: {img}
+ :target: {target}
+ :height: 22
+ :alt: {alt}
+ :class: shield
+''')
#
# Create shields/badges from JSON file