annotate src/plugins/plugin_syntax_dc_wiki.py @ 1806:fd788d24277a

plugin syntax dc_wiki: first draft: handle dotclear wiki syntax /!\ only dc_wiki -> XHTML is handled for now
author Goffi <goffi@goffi.org>
date Sun, 17 Jan 2016 20:39:20 +0100
parents
children 0d3110341947
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1806
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/python
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # SàT plugin for Dotclear Wiki Syntax
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or modify
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # (at your option) any later version.
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # GNU Affero General Public License for more details.
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
19
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 # XXX: ref used: http://dotclear.org/documentation/2.0/usage/syntaxes#wiki-syntax-and-xhtml-equivalent
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
21
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 from sat.core.i18n import _
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
23 from sat.core.log import getLogger
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 log = getLogger(__name__)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 from sat.core.constants import Const as C
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
26 from twisted.words.xish import domish
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 from sat.tools import xml_tools
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
28 import re
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
30 SYNTAX_NAME = "dc_wiki"
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
31
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32 PLUGIN_INFO = {
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 "name": "Dotclear Wiki Syntax Plugin",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 "import_name": "SYNT_DC_WIKI",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 "type": C.PLUG_TYPE_SYNTAXE,
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
36 "dependencies": ["TEXT-SYNTAXES"],
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
37 "main": "DCWikiSyntax",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
38 "handler": "",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
39 "description": _("""Implementation of Dotclear wiki syntax""")
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
40 }
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
42 NOTE_TPL = u'[{}]' # Note template
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
43 NOTE_A_REV_TPL = u'rev_note_{}'
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
44 NOTE_A_TPL = u'note_{}'
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
45
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
46 wiki = [r"\\(?P<escape_char>[][!_+%'|\/*#@{}~?$()-])",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
47 r"^!!!!!(?P<h1_title>.+?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
48 r"^!!!!(?P<h2_title>.+?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
49 r"^!!!(?P<h3_title>.+?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
50 r"^!!(?P<h4_title>.+?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
51 r"^!(?P<h5_title>.+?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
52 r"^----$(?P<horizontal_rule>)",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
53 r"^\*(?P<list_bullet>.*?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
54 r"^#(?P<list_ordered>.*?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
55 r"^ (?P<preformated>.*?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
56 r"^> +?(?P<quote>.*?)$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
57 r"''(?P<emphasis>.+?)''",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
58 r"__(?P<strong_emphasis>.+?)__",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
59 r"%%%(?P<line_break>)",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
60 r"\+\+(?P<insertion>.+?)\+\+",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
61 r"--(?P<deletion>.+?)--",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
62 r"\[(?P<link>.+?)\]",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
63 r"\(\((?P<image>.+?)\)\)",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
64 r"~(?P<anchor>.+?)~",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
65 r"\?\?(?P<acronym>.+?\|.+?)\?\?",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
66 r"{{(?P<inline_quote>.+?)}}",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
67 r"@@(?P<code>.+?)@@",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
68 r"\$\$(?P<footnote>.+?)\$\$",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
69 r"(?P<text>.+?)",
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
70 ]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
71
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
72 wiki_re = re.compile('|'.join(wiki), re.MULTILINE | re.DOTALL)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
73 wiki_block_level_re = re.compile(r"^///html(?P<html>.+?)///\n\n|(?P<paragraph>.+?)(?:\n{2,}|\Z)", re.MULTILINE | re.DOTALL)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
74
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
75
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
76 class DCWikiParser(object):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
77
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
78 def __init__(self):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
79 self._footnotes = None
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
80 for i in xrange(5):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
81 setattr(self,
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
82 'parser_h{}_title'.format(i),
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
83 lambda string, parent, i=i: self._parser_title(string, parent, 'h{}'.format(i)))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
84
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
85 def parser_paragraph(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
86 p_elt = parent.addElement('p')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
87 self._parse(string, p_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
88
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
89 def parser_html(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
90 wrapped_html = "<div>{}</div>".format(string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
91 try:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
92 div_elt = xml_tools.ElementParser()(wrapped_html)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
93 except domish.ParserError as e:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
94 log.warning(u"Error while parsing HTML content, ignoring it: {}".format(e))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
95 return
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
96 children = list(div_elt.elements())
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
97 if len(children) == 1 and children[0].name == 'div':
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
98 div_elt = children[0]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
99 parent.addChild(div_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
100
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
101 def parser_escape_char(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
102 parent.addContent(string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
103
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
104 def _parser_title(self, string, parent, name):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
105 elt = parent.addElement(name)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
106 elt.addContent(string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
107
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
108 def parser_horizontal_rule(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
109 parent.addElement('hr')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
110
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
111 def _parser_list(self, string, parent, list_type):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
112 depth = 0
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
113 while string[depth:depth+1] == '*':
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
114 depth +=1
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
115
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
116 string = string[depth:].lstrip()
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
117
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
118 for i in xrange(depth+1):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
119 list_elt = getattr(parent, list_type)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
120 if not list_elt:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
121 parent = parent.addElement(list_type)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
122 else:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
123 parent = list_elt
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
124
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
125 li_elt = parent.addElement('li')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
126 self._parse(string, li_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
127
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
128 def parser_list_bullet(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
129 self._parser_list(string, parent, 'ul')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
130
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
131 def parser_list_ordered(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
132 self._parser_list(string, parent, 'ol')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
133
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
134 def parser_preformated(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
135 pre_elt = parent.pre
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
136 if pre_elt is None:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
137 pre_elt = parent.addElement('pre')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
138 else:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
139 # we are on a new line, and this is important for <pre/>
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
140 pre_elt.addContent('\n')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
141 pre_elt.addContent(string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
142
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
143 def parser_quote(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
144 blockquote_elt = parent.blockquote
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
145 if blockquote_elt is None:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
146 blockquote_elt = parent.addElement('blockquote')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
147 p_elt = blockquote_elt.p
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
148 if p_elt is None:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
149 p_elt = blockquote_elt.addElement('p')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
150 else:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
151 string = u'\n' + string
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
152
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
153 self._parse(string, p_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
154
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
155 def parser_emphasis(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
156 em_elt = parent.addElement('em')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
157 self._parse(string, em_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
158
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
159 def parser_strong_emphasis(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
160 strong_elt = parent.addElement('strong')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
161 self._parse(string, strong_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
162
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
163 def parser_line_break(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
164 parent.addElement('br')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
165
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
166 def parser_insertion(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
167 ins_elt = parent.addElement('ins')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
168 self._parse(string, ins_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
169
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
170 def parser_deletion(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
171 del_elt = parent.addElement('del')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
172 self._parse(string, del_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
173
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
174 def parser_link(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
175 url_data = string.split(u'|')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
176 a_elt = parent.addElement('a')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
177 length = len(url_data)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
178 if length == 0:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
179 url = url_data[0]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
180 a_elt['href'] = url
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
181 a_elt.addContent(url)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
182 else:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
183 name = url_data[0]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
184 url = url_data[1]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
185 a_elt['href'] = url
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
186 a_elt.addContent(name)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
187 if length >= 3:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
188 a_elt['lang'] = url_data[2]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
189 if length >= 4:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
190 a_elt['title'] = url_data[3]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
191 if length > 4:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
192 log.warning(u"too much data for url, ignoring extra data")
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
193
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
194 def parser_image(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
195 image_data = string.split(u'|')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
196 img_elt = parent.addElement('img')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
197
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
198 for idx, attribute in enumerate(('src', 'alt', 'position', 'longdesc')):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
199 try:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
200 data = image_data[idx]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
201 except IndexError:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
202 break
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
203
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
204 if attribute != 'position':
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
205 img_elt[attribute] = data
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
206 else:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
207 data = data.lower()
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
208 if data in ('l', 'g'):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
209 img_elt['style'] = "display:block; float:left; margin:0 1em 1em 0"
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
210 elif data in ('r', 'd'):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
211 img_elt['style'] = "display:block; float:right; margin:0 0 1em 1em"
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
212 elif data == 'c':
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
213 img_elt['style'] = "display:block; margin-left:auto; margin-right:auto"
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
214 else:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
215 log.warning(u"bad position argument for image, ignoring it")
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
216
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
217 def parser_anchor(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
218 a_elt = parent.addElement('a')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
219 a_elt['id'] = string
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
220
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
221 def parser_acronym(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
222 acronym, title = string.split(u'|',1)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
223 acronym_elt = parent.addElement('acronym', content=acronym)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
224 acronym_elt['title'] = title
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
225
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
226 def parser_inline_quote(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
227 quote_data = string.split(u'|')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
228 quote = quote_data[0]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
229 q_elt = parent.addElement('q', content=quote)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
230 for idx, attribute in enumerate(('lang', 'cite'), 1):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
231 try:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
232 data = quote_data[idx]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
233 except IndexError:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
234 break
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
235 q_elt[attribute] = data
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
236
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
237 def parser_code(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
238 parent.addElement('code', content=string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
239
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
240 def parser_footnote(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
241 idx = len(self._footnotes) + 1
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
242 note_txt = NOTE_TPL.format(idx)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
243 sup_elt = parent.addElement('sup')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
244 sup_elt['class'] = 'note'
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
245 a_elt = sup_elt.addElement('a', content=note_txt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
246 a_elt['id'] = NOTE_A_REV_TPL.format(idx)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
247 a_elt['href'] = u'#{}'.format(NOTE_A_TPL.format(idx))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
248
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
249 p_elt = domish.Element((None, 'p'))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
250 a_elt = p_elt.addElement('a', content=note_txt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
251 a_elt['id'] = NOTE_A_TPL.format(idx)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
252 a_elt['href'] = u'#{}'.format(NOTE_A_REV_TPL.format(idx))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
253 self._parse(string, p_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
254 # footnotes are actually added at the end of the parsing
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
255 self._footnotes.append(p_elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
256
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
257 def parser_text(self, string, parent):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
258 parent.addContent(string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
259
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
260 def _parse(self, string, parent, block_level=False):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
261 regex = wiki_block_level_re if block_level else wiki_re
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
262
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
263 for match in regex.finditer(string):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
264 if match.lastgroup is None:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
265 parent.addContent(string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
266 return
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
267 matched = match.group(match.lastgroup)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
268 try:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
269 parser = getattr(self, 'parser_{}'.format(match.lastgroup))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
270 except AttributeError:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
271 log.warning(u"No parser found for {}".format(match.lastgroup))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
272 # parent.addContent(string)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
273 continue
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
274 parser(matched, parent)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
275
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
276 def parse(self, string):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
277 self._footnotes = []
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
278 div_elt = domish.Element((None, 'div'))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
279 self._parse(string, parent=div_elt, block_level=True)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
280 if self._footnotes:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
281 foot_div_elt = div_elt.addElement('div')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
282 foot_div_elt['class'] = 'footnotes'
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
283 # we add a simple horizontal rule which can be customized
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
284 # with footnotes class, instead of a text which would need
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
285 # to be translated
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
286 foot_div_elt.addElement('hr')
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
287 for elt in self._footnotes:
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
288 foot_div_elt.addChild(elt)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
289 return div_elt
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
290
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
291
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
292 class DCWikiSyntax(object):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
293
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
294 def __init__(self, host):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
295 log.info(_(u"Dotclear wiki syntax plugin initialization"))
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
296 self.host = host
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
297 self._dc_parser = DCWikiParser()
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
298 self._stx = self.host.plugins["TEXT-SYNTAXES"]
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
299 self._stx.addSyntax(SYNTAX_NAME, self.parseWiki, self.parseXHTML, [self._stx.OPT_NO_THREAD])
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
300
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
301 def parseWiki(self, wiki_stx):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
302 div_elt = self._dc_parser.parse(wiki_stx)
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
303 return div_elt.toXml()
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
304
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
305 def parseXHTML(self, xhtml):
fd788d24277a plugin syntax dc_wiki: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
306 raise NotImplementedError