﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9504	Extension for restructuredtext filter a django.contrib.markup	jjconti	nobody	"As suggested at 0 I browserd markup sorce code1 to see how does restructuredtext filter work. I founded that it returns only the fragment part instead on other contet. I suggest an argument fot the filter to be used in parts[arg].

The suggested implementation is, as follow (two small changes):

{{{
def restructuredtext(value, arg=""fragment""):
    try:
        from docutils.core import publish_parts
    except ImportError:
        if settings.DEBUG:
            raise template.TemplateSyntaxError, ""Error in {% restructuredtext %} filter: The Python docutils library isn't installed.""
        return force_unicode(value)
    else:
        docutils_settings = getattr(settings, ""RESTRUCTUREDTEXT_FILTER_SETTINGS"", {})
        parts = publish_parts(source=smart_str(value), writer_name=""html4css1"", settings_overrides=docutils_settings)
        return mark_safe(force_unicode(parts[arg]))
restructuredtext.is_safe = True
}}}


[0] http://docs.djangoproject.com/en/dev/ref/contrib/#ref-contrib-markup

[1] http://code.djangoproject.com/browser/django/trunk/django/contrib/markup/templatetags/markup.py"	New feature	closed	contrib.markup	1.0	Normal	duplicate	markup restructuredtext		Design decision needed	0	0	0	0	0	0
