Metadata-Version: 2.0
Name: django-path2css
Version: 0.1.1
Summary: Convert a request.path ('/a/b/c/d/') into CSS class names
Home-page: https://github.com/kezabelle/django-path2css
Author: Keryn Knight
Author-email: django-path2css@kerynknight.com
License: BSD License
Keywords: django path2css
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Requires-Dist: Django (>=1.8)

django-path2css
===============

:author: Keryn Knight
:version: 0.1.1

.. |travis_stable| image:: https://travis-ci.org/kezabelle/django-path2css.svg?branch=0.1.1
  :target: https://travis-ci.org/kezabelle/django-path2css

.. |travis_master| image:: https://travis-ci.org/kezabelle/django-path2css.svg?branch=master
  :target: https://travis-ci.org/kezabelle/django-path2css

==============  ======
Release         Status
==============  ======
stable (0.1.1)  |travis_stable|
master          |travis_master|
==============  ======

A small Django package for rendering a request's URL as a series of CSS class names,
such that one can target sections or individual parts of a site using CSS only.

For example, say all your blog posts are under ``/blog/``, then you might do::

  {% load path2css %}
  <body class="{% path2css request.path %}">...</body>

Subsequently, going to ``/blog/``, ``/blog/post/``, ``/blog/post/comments/`` etc
will all have the ``blog`` CSS class added to the body, which you could then use::

  body.blog {...}
  body.blog-post {...}
  body.blog-post-comments {...}

Note that blog-post-comments, being the deepest namespace reached, would also have
the ``blog`` and ``blog-post`` classes added.

The templatetag
---------------

In case you're already using the class names that would be generated, ``{% path2css %}``
takes a ``prefix=x`` and/or ``suffix=y`` parameter, so that you can re-namespace things
without clobbering your existing styles::

  {% path2css '/blog/post/' prefix='path-' %}
  {% path2css '/blog/post/' suffix='-area' %}
  {% path2css '/blog/post/' prefix='pre_' suffix='_post' %}

The context processor
---------------------

There's also a context processor which may be used by adding ``path2css.context_processor``
to your existing list. It does the same thing as ``{% path2css %}`` with no
prefix/suffix arguents.


Supported Django versions
-------------------------

The tests are run against Django 1.8 through 1.10, and Python 2.7, 3.3, 3.4 and 3.5.


The license
-----------

It's the `FreeBSD`_. There's should be a ``LICENSE`` file in the root of the repository, and in any archives.

.. _FreeBSD: http://en.wikipedia.org/wiki/BSD_licenses#2-clause_license_.28.22Simplified_BSD_License.22_or_.22FreeBSD_License.22.29


----

Copyright (c) 2016, Keryn Knight
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


----

Change history for django-path2css
-------------------------------------------------------------
0.1.1
^^^^^^
* First release - tests for the template tag & context processor passing on
  all of the ``tox`` matrix.


