aboutsummaryrefslogtreecommitdiffstats
path: root/doc/helpers.py
diff options
context:
space:
mode:
authorPatrick Lehmann <Paebbels@gmail.com>2019-02-25 10:49:35 +0100
committerGitHub <noreply@github.com>2019-02-25 10:49:35 +0100
commita62344e4dce1a603cfda0c71a571e248694974ca (patch)
treee460aa85f9f627daf4d3335ffcaefcb50d4fcb17 /doc/helpers.py
parentfb6fa7ceced6e74ae02ed24b92a488c6e65d3404 (diff)
parentf83f6970faf9b58e1a87b2d73bc046c03dfc603d (diff)
downloadghdl-a62344e4dce1a603cfda0c71a571e248694974ca.tar.gz
ghdl-a62344e4dce1a603cfda0c71a571e248694974ca.tar.bz2
ghdl-a62344e4dce1a603cfda0c71a571e248694974ca.zip
Merge pull request #770 from 1138-4EB/doc-jsonshields
doc: Generate shields from JSON files instead of hard coding 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
+ )