Opened 16 years ago
Closed 12 years ago
#10146 closed New feature (wontfix)
Support for contrib/markdown extension_configs in settings.py
Reported by: | bdejong | Owned by: | nobody |
---|---|---|---|
Component: | contrib.markup | Version: | dev |
Severity: | Normal | Keywords: | markdown config extensions extension_configs |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Markdown has support for "extension configs". For example: the "wikilink" extension normally turns [[link]]
into <a href="/link/" class="wikilink">link</a>
, but if you want to change the link class or the prefix of the URL you need to do this through configuration of the extension.
This patch allows you to add the configuration in the settings.py file as such:
MARKDOWN_EXTENSION_CONFIGS = { 'wikilink': [ ('base_url', '/help/'), ('end_url', ''), ('html_class', 'wikilink') ] }
It's a very small patch but helps a lot when using markdown extensions. Almost all extensions have some form of configuration available.
Attachments (2)
Change History (17)
by , 16 years ago
Attachment: | markup_extension_configs.diff added |
---|
comment:1 by , 16 years ago
Ah, saw that the restrucured text markup template used a different name (and method of getting the config) for the config value. Changed the code to match that example:
MARKDOWN_FILTER_SETTINGS = {'wikilink': [('base_url', '/help/'), ('end_url', '/'), ('html_class', 'wikilink')]}
Now using:
extension_configs = getattr(settings, "MARKDOWN_FILTER_SETTINGS", {}) md = markdown.Markdown(extensions=extensions, extension_configs=extension_configs, safe_mode=safe_mode)
by , 16 years ago
Attachment: | markup_extension_configs_docs.diff added |
---|
documentation for additional (and django 1.0) markup parameters and settings
comment:2 by , 16 years ago
The documentation diff also includes documentation for features which were already in django 1.0, but were not documented.
I.e. the usage of RESTRUCTUREDTEXT_FILTER_SETTINGS and markdown extensions.
comment:4 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 16 years ago
Maybe MarkupField (#10317) will solve this in more generic and elegant way?
comment:8 by , 15 years ago
The request for documentation for reST filter support has been split off to #13310; this ticket is now solely for the feature of supporting Markdown extensions.
comment:10 by , 14 years ago
Component: | Contrib apps → contrib.markup |
---|
comment:11 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:12 by , 14 years ago
Needs tests: | set |
---|
Could someone write tests for this? Also, all changes would need to be combined in one single diff patch.
comment:15 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
contrib.markup has been deprecated (#18504) and will be removed in Django 1.6. Closing as obsolete.
markdown extension_configs patch, svn revision 9791 version