<commit_before>========================
django-smileys |mrgreen|
========================

Django-smileys is a django application providing utilities to add
*smiley images* in your templates.

.. contents::

Install
=======

Install the package in your *PYTHON_PATH* by getting the sources and run
**setup.py** or use *pip*::

  $ pip install -e git://github.com/Fantomas42/django-smileys.git#egg=django-smileys

Then register the **smileys** app in your *INSTALLED_APPS* project's
section.

Examples
========

Filter Usage
------------

For our example we will make a template who display the field *content* of
a model, this field has this value: ::

  Coding is fun and sexy :D

So in our templates we will load the **smiley_tags** library and use the
**smileys** filter: ::

  {% load smiley_tags %}

  {{ object.content|smileys }}

Which will render:

  Coding is fun and sexy |smile|

Tag Usage
---------

The smileys app also provides a tag named **smileys** for converting raw
text. ::

  {% load smiley_tags %}
  {% smileys %}
  Documenting is boring but usefull :p
  {% endsmileys %}

Which will render :

  Documenting is boring but usefull |razz|

So cool, no ?

Settings
========

You can use differents settings for customizing the application.

* SMILEYS_URL

The url where the smileys files are located, use this as default.::

  os.path.join(settings.MEDIA_URL, 'smileys/'))

* SMILEYS_CLASS

The class wo will be applied to the *img* markup of the smileys.

* SMILEYS_LIST

The list of the smileys who will be converted. It's something like that: ::

  ((':)', 'smile.gif'),
   (':D', 'mrgreen.gif'),
   (':(', 'sad.gif'),
   (':|', 'neutral.gif'),
   (';)', 'wink.gif'),
   (':p', 'razz.gif'),
   (':P', 'razz.gif'),
   (':o', 'surprised.gif'),
   (':O', 'surprised.gif'),
   (':s', 'confused.gif'),
   (':S', 'confused.gif'),
   (':$', 'confused.gif'),
   ('o_O', 'eek.gif'),
   )

Of course the package does not provide the images, is your job to find and
set them in your project.

.. |razz| image:: http://media.fache.fr/img/smileys/razz.gif
.. |smile| image:: http://media.fache.fr/img/smileys/smile.gif
.. |mrgreen| image:: http://media.fache.fr/img/smileys/mrgreen.gif<commit_msg>Restaure smileys URLs in the README<commit_after>========================
django-smileys |mrgreen|
========================

Django-smileys is a django application providing utilities to add
*smiley images* in your templates.

.. contents::

Install
=======

Install the package in your *PYTHON_PATH* by getting the sources and run
**setup.py** or use *pip*::

  $ pip install -e git://github.com/Fantomas42/django-smileys.git#egg=django-smileys

Then register the **smileys** app in your *INSTALLED_APPS* project's
section.

Examples
========

Filter Usage
------------

For our example we will make a template who display the field *content* of
a model, this field has this value: ::

  Coding is fun and sexy :D

So in our templates we will load the **smiley_tags** library and use the
**smileys** filter: ::

  {% load smiley_tags %}

  {{ object.content|smileys }}

Which will render:

  Coding is fun and sexy |smile|

Tag Usage
---------

The smileys app also provides a tag named **smileys** for converting raw
text. ::

  {% load smiley_tags %}
  {% smileys %}
  Documenting is boring but usefull :p
  {% endsmileys %}

Which will render :

  Documenting is boring but usefull |razz|

So cool, no ?

Settings
========

You can use differents settings for customizing the application.

* SMILEYS_URL

The url where the smileys files are located, use this as default.::

  os.path.join(settings.MEDIA_URL, 'smileys/'))

* SMILEYS_CLASS

The class wo will be applied to the *img* markup of the smileys.

* SMILEYS_LIST

The list of the smileys who will be converted. It's something like that: ::

  ((':)', 'smile.gif'),
   (':D', 'mrgreen.gif'),
   (':(', 'sad.gif'),
   (':|', 'neutral.gif'),
   (';)', 'wink.gif'),
   (':p', 'razz.gif'),
   (':P', 'razz.gif'),
   (':o', 'surprised.gif'),
   (':O', 'surprised.gif'),
   (':s', 'confused.gif'),
   (':S', 'confused.gif'),
   (':$', 'confused.gif'),
   ('o_O', 'eek.gif'),
   )

Of course the package does not provide the images, is your job to find and
set them in your project.

.. |razz| image:: http://static.fache.fr/img/smileys/razz.gif
.. |smile| image:: http://static.fache.fr/img/smileys/smile.gif
.. |mrgreen| image:: http://static.fache.fr/img/smileys/mrgreen.gif
{'fraction_non_alphanumeric': 0.1816542709037638, 'fraction_numerical': 0.000901510029299076, 'mean_word_length': 3.7112526539278132, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '850296', 'n_tokens_mistral': 1579, 'n_tokens_neox': 1497, 'n_words': 496}