On Tuesday, September 16, 2014 12:56:05 PM UTC-7, Guy Rutenberg wrote: > > Hi, > > I want to convert pages in the Wiki syntax used by Trac to markdown. Is > there a good solution? > > I found a few very shorts scripts that attempt to do so, but none that > really looked promising. I've also considered using WikiParser from > trac.wiki to get a DOM tree of the trac wiki and then write code that will > convert it to markdown, but I've ran into problems using WikiParser. > > I've tried: > > from trac.wiki import WikiParser > from trac.core import ComponentManager > > wp = WikiParser(ComponentManager()) > wp.parse(my_wiki_text) > > But the last line simply returns my_wiki_text as is, instead of a WikiDOM > tree as the documentations says. Any idea what I did wrong? >
You didn't do anything wrong. The "parse" method hasn't been implemented yet, and the Trac API doesn't produce a WikiDOM tree yet: http://trac.edgewall.org/browser/trunk/trac/wiki/parser.py?marks=222,225&rev=12732#L211 You might take a look at this proposal, but I don't know of anything that will directly help you at the moment. http://trac.edgewall.org/wiki/TracDev/Proposals/WikiParserFormatterSplit -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/trac-users. For more options, visit https://groups.google.com/d/optout.
