diff --git a/docs/source/index.rst b/docs/source/index.rst index 5b39c7d..5cbe0cb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -46,38 +46,27 @@ Shields & Usage Shield Styling ============== -You can change the style of the shield from the rounded corners to a cleaner, -flat style by setting a style value in the REQUEST_URI. - -If no style is provided, the default rounded corner style will be used, setting -the style value to 'flat' will use the flat style as seen below. +You can change the styling of the shields to use be flat with rounded corners (default), +flat with squared corners or the old plastic style .. code:: ?style=flat -Original vs flat comparison ---------------------------- - -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| Original | Flat | -+================================================================+===========================================================================+ -| .. image:: https://pypip.in/download/blackhole/badge.svg | .. image:: https://pypip.in/download/blackhole/badge.svg?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| .. image:: https://pypip.in/version/blackhole/badge.svg | .. image:: https://pypip.in/version/blackhole/badge.svg?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| .. image:: https://pypip.in/py_versions/blackhole/badge.svg | .. image:: https://pypip.in/py_versions/blackhole/badge.svg ?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| .. image:: https://pypip.in/implementation/blackhole/badge.svg | .. image:: https://pypip.in/implementation/blackhole/badge.svg?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| .. image:: https://pypip.in/wheel/blackhole/badge.svg | .. image:: https://pypip.in/wheel/blackhole/badge.svg?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| .. image:: https://pypip.in/egg/blackhole/badge.svg | .. image:: https://pypip.in/egg/blackhole/badge.svg?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| .. image:: https://pypip.in/format/blackhole/badge.svg | .. image:: https://pypip.in/format/blackhole/badge.svg?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ -| .. image:: https://pypip.in/license/blackhole/badge.svg | .. image:: https://pypip.in/license/blackhole/badge.svg?style=flat | -+----------------------------------------------------------------+---------------------------------------------------------------------------+ +.. image:: https://pypip.in/download/blackhole/badge.svg?style=flat + +.. code:: + + ?style=flat-square + +.. image:: https://pypip.in/download/blackhole/badge.svg?style=flat-square + +.. code:: + + ?style=plastic + +.. image:: https://pypip.in/download/blackhole/badge.svg?style=plastic + Using other image formats ========================= diff --git a/shields/shields.py b/shields/shields.py index d5170f9..2eda3a5 100644 --- a/shields/shields.py +++ b/shields/shields.py @@ -97,9 +97,11 @@ def write_shield(self, status, colour='brightgreen'): colour, self.format, ) - style = self.request.args.get('style', None) - if style is not None and style[0] in ['flat', ]: - shield_url += "?style={0}".format(style[0]) + style = self.request.args.get('style', 'flat') + if style is not None and style[0] in ['flat', 'flat-square', 'plastic' ]: + style = style[0] + shield_url += "?style={0}".format(style) + shield_url = shield_url.replace(" ", "_") ihash = self.hash(shield_url) cache = os.path.join(FILE_CACHE, ihash)