Another post about reStructuredText: can you convert reStructuredText into Wiki format? I found in Docutils sandbox a tool: `rst2wiki`

. It currently supports conversion to TWiki and Atlassian Confluence. `rst2wiki`

is available through SVN (web-access)

In Docutils >= 0.8, there is “math” support; on the other hand, TWiki can display LaTeX equations if MathModePlugin is installed and set up properly. The syntax is

<latex [attr="value"]* > formula </latex>

In order to use `rst2wiki`

with math support, we will modify `wiki.py`

. In class `WikiTranslator`

, add:

###
# Start Math
#
def visit_math(self, node):
if self.math_start:
self.body.append(self.math_start)
def depart_math(self, node):
if self.math_end:
self.body.append(self.math_end)
#
# End Math
###

In class `TWikiTranslator`

, add:

self.math_start = '<latex>'
self.math_end = '</latex>'

Done :)

### Like this:

Like Loading...

*Related*

## Leave a Reply