]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Self-host PyPI-related badges
authorŁukasz Langa <lukasz@langa.pl>
Mon, 26 Mar 2018 09:11:16 +0000 (02:11 -0700)
committerŁukasz Langa <lukasz@langa.pl>
Mon, 26 Mar 2018 09:15:13 +0000 (02:15 -0700)
.gitignore
README.md
docs/_static/license.svg [new file with mode: 0644]
docs/_static/pypi_template.svg [new file with mode: 0644]
docs/conf.py

index 88f07d001c4182813c5a20f53241cb9c667e4887..5d81454c73c098dd81e87ef7f7a781a95b21968b 100644 (file)
@@ -1,3 +1,4 @@
 .coverage
 _build
-.DS_Store
\ No newline at end of file
+.DS_Store
+docs/_static/pypi.svg
index dfbcc51f2c22d627cc560115d1b6f6fdb0a1ee93..8aa0d06ee55c23f2a0ec9cca99899408ebc2c5f6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,8 +5,8 @@
 <a href="https://travis-ci.org/ambv/black"><img alt="Build Status" src="https://travis-ci.org/ambv/black.svg?branch=master"></a>
 <a href="http://black.readthedocs.io/en/latest/?badge=latest"><img alt="Documentation Status" src="http://readthedocs.org/projects/black/badge/?version=latest"></a>
 <a href="https://coveralls.io/github/ambv/black?branch=master"><img alt="Coverage Status" src="https://coveralls.io/repos/github/ambv/black/badge.svg?branch=master"></a>
-<a href="https://github.com/ambv/black/blob/master/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-7900CA.svg"></a>
-<img alt="PyPI" src="https://img.shields.io/pypi/v/black.svg">
+<a href="https://github.com/ambv/black/blob/master/LICENSE"><img alt="License: MIT" src="http://black.readthedocs.io/en/latest/_static/license.svg"></a>
+<a href="https://pypi.python.org/pypi/black"><img alt="PyPI" src="http://black.readthedocs.io/en/latest/_static/pypi.svg"></a>
 <a href="https://github.com/ambv/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
 </p>
 
diff --git a/docs/_static/license.svg b/docs/_static/license.svg
new file mode 100644 (file)
index 0000000..36bea29
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="78" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h47v20H0z"/><path fill="#7900CA" d="M47 0h31v20H47z"/><path fill="url(#b)" d="M0 0h78v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><text x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text><text x="245" y="140" transform="scale(.1)" textLength="370">license</text><text x="615" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">MIT</text><text x="615" y="140" transform="scale(.1)" textLength="210">MIT</text></g> </svg>
\ No newline at end of file
diff --git a/docs/_static/pypi_template.svg b/docs/_static/pypi_template.svg
new file mode 100644 (file)
index 0000000..435d6bb
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="88" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="88" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h55v20H33z"/><path fill="url(#b)" d="M0 0h88v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"><text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="595" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="450">v18.3a4</text><text x="595" y="140" transform="scale(.1)" textLength="450">$version</text></g> </svg>
index 19a161b6bce6ce29cbef015e8587e7dd67d7de74..5d0e9e3c6d183c10f416e4085a4ea775ac82f8a9 100644 (file)
@@ -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 ---------------------------------------------------