From f83f6970faf9b58e1a87b2d73bc046c03dfc603d Mon Sep 17 00:00:00 2001 From: 1138-4EB <1138-4EB@users.noreply.github.com> Date: Sat, 23 Feb 2019 23:03:41 +0100 Subject: doc: generate shields from json files instead of hardcoding all of the in inc files --- doc/helpers.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/helpers.py') 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 + ) -- cgit v1.2.3