Skip to main content

A Django template filter to convert ASCII punctuation into typographic punctuation HTML entities.

Project description

Django Smarty
*************

|PyPI version|_ |Build status|_

.. |PyPI version| image::
https://badge.fury.io/py/django-smarty.svg
.. _PyPI version: https://pypi.python.org/pypi/django-smarty

**Django Smarty** is a `Django <https://www.djangoproject.com/>`_ `template filter <https://docs.djangoproject.com/en/2.0/howto/custom-template-tags/>`_ application to convert ASCII punctuation characters into smart typographic punctuation HTML entities with `SmartyPants <https://daringfireball.net/projects/smartypants/>`_. Uses the `Python smartypants <https://pypi.python.org/pypi/smartypants>`_ package.

* `Package distribution <https://pypi.python.org/pypi/django-smarty>`_
* `Code repository <https://github.com/richardcornish/django-smarty>`_

Install
=======

.. code-block:: bash

$ pipenv install django-smarty

Add to ``settings.py``.

.. code-block:: python

INSTALLED_APPS = [
# ...
'smarty',
]

Usage
=====

.. code-block:: django

{% load smarty_tags %}

{{ post.body|smarty }}

Result:

.. code-block:: html

&#8220;Hello&#8212;world!&#8221;


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-smarty-0.1.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

django_smarty-0.1.0-py2.py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page