rst settings

3 views
Skip to first unread message

Jeff Anderson

unread,
Jun 12, 2009, 2:10:58 PM6/12/09
to smug...@googlegroups.com
I had created a patch that forced rst to use a different setting, but
changing that behavior in smug's source code seemed wrong. I figured
that making a setting for settings.py for per-site settings for rst was
the way to go, but I didn't want to make *yet another setting*. I looked
at Django's rst markup template tag, and they already had a setting:
RESTRUCTUREDTEXT_FILTER_SETTINGS which is a dictionary that takes all
the settings that can modify how the source is parsed or output.

At this time this will be used on both the html and latex writers.
The Docutils writers seems to ignore settings it receives that are
specific to other writers, so you can mix and match all the settings you
want.

Here are the settings I like to use:

RESTRUCTUREDTEXT_FILTER_SETTINGS = {'file_insertion_enabled': False,
'cloak_email_addresses': True, 'hyperlink_color': 0}

The first setting works for both html and latex. The second works for
only html, and the third works for only latex.

This patch defaults to an empty settings dictionary, which makes this
patch 100% backwards compatible. It might be a sane and sensible default
to turn off file insertion by default, otherwise docutils chokes and
smug throws a 500 error.

rstsettings.diff
Reply all
Reply to author
Forward
0 new messages