Attachment 'text_markdown.py'
Download 1 """
2 MoinMoin - Parser for Markdown
3
4 Syntax:
5
6 To use in a code block:
7
8 {{{{#!text_markdown
9 <add markdown text here>
10 }}}}
11
12 To use for an entire page:
13
14 #format text_markdown
15 <add markdown text here>
16
17 @copyright: 2009 by Jason Fruit (JasonFruit at g mail dot com)
18 @license: GNU GPL, see http://www.gnu.org/licenses/gpl for details
19
20 """
21
22
23 from markdown import markdown
24
25 Dependencies = ['user']
26
27 class Parser:
28 """
29 A thin wrapper around a Python implementation
30 (http://www.freewisdom.org/projects/python-markdown/) of John
31 Gruber's Markdown (http://daringfireball.net/projects/markdown/)
32 to make it suitable for use with MoinMoin.
33 """
34 def __init__(self, raw, request, **kw):
35 self.raw = raw
36 self.request = request
37 def format(self, formatter):
38 output_html = markdown(self.raw)
39 try:
40 self.request.write(formatter.rawHTML(output_html))
41 except:
42 self.request.write(formatter.escapedText(output_html))
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.