Skip to content

Commit

Permalink
Updated styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Kura committed Mar 15, 2015
1 parent dea6170 commit a5c533f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 30 deletions.
43 changes: 16 additions & 27 deletions docs/source/index.rst
Expand Up @@ -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
=========================
Expand Down
8 changes: 5 additions & 3 deletions shields/shields.py
Expand Up @@ -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)
Expand Down

0 comments on commit a5c533f

Please sign in to comment.