Skip to content

Commit

Permalink
Updates README, MANIFEST and setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandBordage committed Jun 30, 2013
1 parent 1322023 commit 683f069
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 24 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include README.rst COPYING
include README.rst COPYING AUTHORS.rst CHANGELOG.rst requi
recursive-include terms *.html *.po *.mo *.txt *.json
54 changes: 35 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Requirements
Mandatory
---------

* `Python <http://python.org/>`_ 2.6, 2.7, 3.2 or 3.3
* `Python <http://python.org/>`_ 2.6, 2.7, 3.2, or 3.3
* `Django <https://www.djangoproject.com/>`_ 1.4 or 1.5
* `beautifulsoup4 <http://www.crummy.com/software/BeautifulSoup/>`_

Expand Down Expand Up @@ -74,12 +74,10 @@ Usage

* `Middleware`_ (to give django-terms a try or for development)
* `Template filter`_ (for production)
* `cms_plugin_processor`_ (if you are using django-CMS)
* `With django-CMS`_

The added terms should now be automatically linked to their definitions.

For django-CMS users : display all terms and their definitions with the `TermsIndexPlugin`_.


Middleware
----------
Expand Down Expand Up @@ -155,26 +153,43 @@ Example:
TERMS_ADDITIONAL_IGNORED_CLASSES = ['code-snippet']


cms_plugin_processor
--------------------
With django-CMS
---------------

A few tools are available to make your life easier if you use `django-CMS`_.

Plugin processor
................

A cms_plugin_processor is available if you are using django-CMS.
It will parse all plugin output.
It will automatically apply the `template filter` on every plugin.

Add this in `settings.py`::
To use it, add or modify ``CMS_PLUGIN_PROCESSORS`` in `settings.py`::

CMS_PLUGIN_PROCESSORS = (
[...]
...
'terms.cms_plugin_processors.TermsProcessor',
[...]
...
)

TermsIndexPlugin
----------------
Terms Index Plugin
..................

This plugin displays all terms and their definitions.

Don't forget to update ``CMS_PLACEHOLDER_CONF`` in your `settings.py`
if you defined it, otherwise this plugin will not be available from your
placeholders.

Apart from this, nothing to do to make it work.

App hook and menu
.................

You can use the the app hook and the menu to integrate the complete glossary
to your CMS architecture.

Nothing to do to make it work.

If you are using django-CMS, you can display all terms and their definitions
with the "Terms Index Plugin".


Settings
Expand Down Expand Up @@ -292,11 +307,12 @@ Why?
When using django-terms, your HTML pages are totally or partially
reconstructed:

* totally reconstructed if you use the middleware (see `Middleware`_)
* partially reconstructed if you use the filter (see `Template filter`_)
* totally reconstructed if you use the `middleware`_
* partially reconstructed if you use the `template filter`_
or `with django-CMS`_

The content is parsed and rebuilt with `beautifulsoup4`_. See `tems/html.py`
to understand exactly how it is rebuilt.
to understand exactly how.

List of known side effects
..........................
Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/usr/bin/env python
# coding: utf-8
import os

from setuptools import setup, find_packages
from terms import version_string


CURRENT_PATH = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(CURRENT_PATH, 'requirements.txt')) as f:
required = f.read().splitlines()


setup(
name='django-terms',
version=version_string,
Expand All @@ -25,10 +32,7 @@
],
license='BSD',
packages=find_packages(),
install_requires=[
'Django >= 1.4',
'beautifulsoup4',
],
install_requires=required,
include_package_data=True,
zip_safe=False,
)

0 comments on commit 683f069

Please sign in to comment.