Commit ea392495 by Bridger Maxwell

Disabled wikipath markdown extension, as it requires markdown 2.1.0, and we are running 2.0.3

parent b1377f6c
#!/usr/bin/env python
'''
WikiLink Extention for Python-Markdown
======================================
Converts CamelCase words to relative links. Requires Python-Markdown 1.6+
Basic usage:
>>> import markdown
>>> text = "Some text with a WikiLink."
>>> md = markdown.markdown(text, ['wikilink'])
>>> md
'\\n<p>Some text with a <a href="/WikiLink/" class="wikilink">WikiLink</a>.\\n</p>\\n\\n\\n'
To define custom settings the simple way:
>>> md = markdown.markdown(text,
... ['wikilink(base_url=/wiki/,end_url=.html,html_class=foo)']
... )
>>> md
'\\n<p>Some text with a <a href="/wiki/WikiLink.html" class="foo">WikiLink</a>.\\n</p>\\n\\n\\n'
Custom settings the complex way:
>>> md = markdown.Markdown(text,
... extensions = ['wikilink'],
... extension_configs = {'wikilink': [
... ('base_url', 'http://example.com/'),
... ('end_url', '.html'),
... ('html_class', '') ]},
... encoding='utf8',
... safe_mode = True)
>>> str(md)
'\\n<p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.\\n</p>\\n\\n\\n'
Use MetaData with mdx_meta.py (Note the blank html_class in MetaData):
>>> text = """wiki_base_url: http://example.com/
... wiki_end_url: .html
... wiki_html_class:
...
... Some text with a WikiLink."""
>>> md = markdown.Markdown(text, ['meta', 'wikilink'])
>>> str(md)
'\\n<p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.\\n</p>\\n\\n\\n'
From the command line:
python markdown.py -x wikilink(base_url=http://example.com/,end_url=.html,html_class=foo) src.txt
By [Waylan Limberg](http://achinghead.com/).
Project website: http://achinghead.com/markdown-wikilinks/
Contact: waylan [at] gmail [dot] com
License: [BSD](http://www.opensource.org/licenses/bsd-license.php)
Version: 0.4 (Oct 14, 2006)
Dependencies:
* [Python 2.3+](http://python.org)
* [Markdown 1.6+](http://www.freewisdom.org/projects/python-markdown/)
* For older dependencies use [WikiLink Version 0.3]
(http://code.limberg.name/svn/projects/py-markdown-ext/wikilinks/tags/release-0.3/)
'''
# THIS ONLY WORKS WITH MARKDOWN 2.1.0
import markdown
try:
......
......@@ -267,7 +267,7 @@ class Revision(models.Model):
# Create pre-parsed contents - no need to parse on-the-fly
ext = WIKI_MARKDOWN_EXTENSIONS
ext += ["wikipath(base_url=%s)" % reverse('wiki_view', args=('/',))]
#ext += ["wikipath(base_url=%s)" % reverse('wiki_view', args=('/',))]
print ext
self.contents_parsed = markdown(self.contents,
extensions=ext,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment