moin2doku/moinformat.py
Elan Ruusamäe 9476b4d684 native formatter based on html formatter
old changes from Feb 10, 2011
2012-06-19 23:22:44 +02:00

29 lines
553 B
Python
Executable file

#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
from MoinMoin import wikimacro, wikiutil
from MoinMoin.Page import Page
from MoinMoin.parser.wiki import Parser
from text_dokuwiki import Formatter
from MoinMoin.request import RequestCLI
request = RequestCLI()
formatter = Formatter(request)
text = """
= Headers =
== Header 2 ==
=== Header 3 ===
==== Header 4 ====
===== Header 5 =====
"""
parser = Parser(text, request)
# this needed for macros
request.formatter = formatter
p = Page(request, "test")
formatter.setPage(p)
parser.format(formatter)