X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/74f8c1316ce36bb551db709d1a85fa90254b94dd..4b8823e5633b22d13650cad6e06b0330ce9985fc:/docs/conf.py diff --git a/docs/conf.py b/docs/conf.py index 19a161b..5d0e9e3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,7 @@ import ast from pathlib import Path import re +import string from recommonmark.parser import CommonMarkParser @@ -30,6 +31,15 @@ def get_version(): return str(ast.literal_eval(version)) +def make_pypi_svg(version): + template = CURRENT_DIR / '_static' / 'pypi_template.svg' + target = CURRENT_DIR / '_static' / 'pypi.svg' + with open(str(template), 'r', encoding='utf8') as f: + svg = string.Template(f.read()).substitute(version=version) + with open(str(target), 'w', encoding='utf8') as f: + f.write(svg) + + # -- Project information ----------------------------------------------------- project = 'Black' @@ -43,6 +53,8 @@ release = get_version() version = release for sp in 'abcfr': version = version.split(sp)[0] +make_pypi_svg(release) + # -- General configuration ---------------------------------------------------