aboutsummaryrefslogtreecommitdiffstats
path: root/doc/helpers.py
diff options
context:
space:
mode:
author1138-4EB <1138-4EB@users.noreply.github.com>2019-02-23 23:03:41 +0100
committer1138-4EB <1138-4EB@users.noreply.github.com>2019-02-25 07:59:36 +0100
commitf83f6970faf9b58e1a87b2d73bc046c03dfc603d (patch)
treee460aa85f9f627daf4d3335ffcaefcb50d4fcb17 /doc/helpers.py
parentfb6fa7ceced6e74ae02ed24b92a488c6e65d3404 (diff)
downloadghdl-f83f6970faf9b58e1a87b2d73bc046c03dfc603d.tar.gz
ghdl-f83f6970faf9b58e1a87b2d73bc046c03dfc603d.tar.bz2
ghdl-f83f6970faf9b58e1a87b2d73bc046c03dfc603d.zip
doc: generate shields from json files instead of hardcoding all of the in inc files
Diffstat (limited to 'doc/helpers.py')
-rw-r--r--doc/helpers.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/helpers.py b/doc/helpers.py
index dd028037e..bd8d10ad4 100644
--- a/doc/helpers.py
+++ b/doc/helpers.py
@@ -214,3 +214,22 @@ def printReleasesList(releases, latex=False):
rs[x+1] = [r[1][1:-7]] + r
printTab(rs)
+
+#
+# Create shields/badges from JSON file
+#
+
+def createShields(file='shields'):
+ shields = getJSON(file)
+ for k, v in shields.items():
+ t = v['target']
+ if t[0:3] == 'gh:':
+ t = 'https://github.com/' + t[3:]
+
+ printShieldSrc(
+ 'SHIELD:'+k,
+ v['alt'],
+ 'https://img.shields.io/' + v['src'] + '&style=flat-square&longCache=true',
+ t,
+ False
+ )