Commits

Anonymous committed b6686fd

rename MARKUP_FILTER to MARKITUP_FILTER to avoid conflict with other apps

Comments (0)

Files changed (4)

 
         - Add ``url(r'^markitup/', include('markitup.urls')`` in your
           root URLconf.
-        - Set the MARKUP_FILTER setting (see `Using AJAX preview`_
-          below).
+        - Set `the MARKITUP_FILTER setting`_.
 
 Using the MarkItUp! widget
 ==========================
 For a seamless markup-handling solution, django-markitup also provides
 a ``MarkupField`` model field that automatically renders and stores
 both its raw and rendered values in the database, using the value of
-the ``MARKUP_FILTER`` setting to parse the markup into HTML.
+`the MARKITUP_FILTER setting`_ to parse the markup into HTML.
 
 A ``MarkupField`` is easy to add to any model definition::
 
 
 If you've included ``markitup.urls`` in your root URLconf (as
 demonstrated above under `Installation`_), all you need to enable
-server-side AJAX preview is the ``MARKUP_FILTER`` setting.
-
-``MARKUP_FILTER`` must be a two-tuple.
-
-The first element must be a string, the Python dotted path to a markup
-filter function.  This function should accept markup as its first
-argument and return HTML.  It may accept other keyword arguments as
-well.  You may parse your markup for preview using any method you
-choose, as long as you can wrap it in a function that meets these
-criteria.
-
-The second element must be a dictionary of keyword arguments to pass
-to the filter function.  The dictionary may be empty.
-
-For example, if you have python-markdown installed, you could use it
-like this::
-
-    MARKUP_FILTER = ('markdown.markdown', {'safe_mode': True})
-
-Alternatively, you could use the "textile" filter provided by Django
-like this::
-
-    MARKUP_FILTER = ('django.contrib.markup.templatetags.markup.textile', {})
-
-(The textile filter function doesn't accept keyword arguments, so the
-kwargs dictionary must be empty in this case.)
-
-``django-markitup`` provides one sample rendering function,
-``render_rest`` in the ``markitup.renderers`` module.
+server-side AJAX preview is `the MARKITUP_FILTER setting`_.
 
 The rendered HTML content is displayed in the Ajax preview wrapped by
 an HTML page generated by the ``markitup/preview.html`` template; you
 **Note:** If you use your own custom MarkItUp! set, be sure to set the
   ``previewParserPath`` option to ``'/markitup/preview/'``.
 
+The MARKITUP_FILTER setting
+===========================
+
+The ``MARKITUP_FILTER`` setting defines how markup is transformed into
+HTML on your site.
+
+``MARKITUP_FILTER`` must be a two-tuple.
+
+The first element must be a string, the Python dotted path to a markup
+filter function.  This function should accept markup as its first
+argument and return HTML.  It may accept other keyword arguments as
+well.  You may parse your markup using any method you choose, as long
+as you can wrap it in a function that meets these criteria.
+
+The second element must be a dictionary of keyword arguments to pass
+to the filter function.  The dictionary may be empty.
+
+For example, if you have python-markdown installed, you could use it
+like this::
+
+    MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})
+
+Alternatively, you could use the "textile" filter provided by Django
+like this::
+
+    MARKITUP_FILTER = ('django.contrib.markup.templatetags.markup.textile', {})
+
+(The textile filter function doesn't accept keyword arguments, so the
+kwargs dictionary must be empty in this case.)
+
+``django-markitup`` provides one sample rendering function,
+``render_rest`` in the ``markitup.renderers`` module.
 
 Other settings
 ==============
 -----------------------
 
 This optional setting can be used to override the markup filter used
-for the Ajax preview view. It has the same format as
-``MARKUP_FILTER``; by default it is set equal to ``MARKUP_FILTER``.
+for the Ajax preview view, if for some reason you need it to be
+different from the filter used for rendering markup in a
+``MarkupField``. It has the same format as ``MARKITUP_FILTER``; by
+default it is set equal to ``MARKITUP_FILTER``.
 
 JQUERY_URL
 ----------

markitup/fields.py

     return curry(func, **kwargs)
 
 try:
-    render_func = _get_render_func(settings.MARKUP_FILTER[0],
-                                   **settings.MARKUP_FILTER[1])
+    render_func = _get_render_func(settings.MARKITUP_FILTER[0],
+                                   **settings.MARKITUP_FILTER[1])
 except ImportError, e:
-    raise ImproperlyConfigured("Could not import MARKUP_FILTER %s: %s" %
-                               (settings.MARKUP_FILTER, e))
+    raise ImproperlyConfigured("Could not import MARKITUP_FILTER %s: %s" %
+                               (settings.MARKITUP_FILTER, e))
 except AttributeError, e:
-    raise ImproperlyConfigured("MARKUP_FILTER setting is required")
+    raise ImproperlyConfigured("MARKITUP_FILTER setting is required")
 
 class Markup(object):
     def __init__(self, instance, field_name, rendered_field_name):

markitup/settings.py

 """
 settings for django-markitup
 
-Time-stamp: <2009-11-05 16:28:48 carljm settings.py>
+Time-stamp: <2009-11-11 12:28:49 carljm settings.py>
 
 """
 from django.conf import settings
 
 
 MARKITUP_PREVIEW_FILTER = getattr(settings, 'MARKITUP_PREVIEW_FILTER',
-                                  getattr(settings, 'MARKUP_FILTER', None))
+                                  getattr(settings, 'MARKITUP_FILTER', None))
 MARKITUP_MEDIA_URL = getattr(settings, 'MARKITUP_MEDIA_URL', settings.MEDIA_URL)
 MARKITUP_SET = getattr(settings, 'MARKITUP_SET', 'markitup/sets/default')
 MARKITUP_SKIN = getattr(settings, 'MARKITUP_SKIN', 'markitup/skins/simple')

tests/test_settings.py

 
 ROOT_URLCONF = 'tests.urls'
 
-MARKUP_FILTER = ('tests.filter.testfilter', {'arg': 'replacement'})
+MARKITUP_FILTER = ('tests.filter.testfilter', {'arg': 'replacement'})