[Trac-tickets] Re: [The Trac Project] #2296: Export wiki pages to latex

The Trac Project noreply at edgewall.com
Mon May 8 00:36:52 CDT 2006


#2296: Export wiki pages to latex
--------------------------+-------------------------------------------------
 Reporter:  emilk at gmx.de  |        Owner:  athomas 
     Type:  enhancement   |       Status:  assigned
 Priority:  normal        |    Milestone:          
Component:  wiki          |      Version:  devel   
 Severity:  normal        |   Resolution:          
 Keywords:  converter     |  
--------------------------+-------------------------------------------------
Comment (by athomas):

 And here's a quick example for converting Wiki text to text with the
 formatting stripped:

 {{{
 #!python
 from trac.core import *
 from trac.wiki.formatter import wiki_to_html
 from trac.mimeview.api import IMIMETypeConverter

 class StrippedWikiConverter(Component):
     implements(IMIMETypeConverter)

     def get_mime_conversions(self):
         yield ('strippedtxt', 'Plain Text (no formatting)', 'text/x-trac-
 wiki', 'text/plain', 9)

     def convert_mime_content(self, req, mimetype, content, key,
 filename=None, url=None):
         return (wiki_to_html(content, self.env, req).plaintext(),
 'text/plain;charset=utf-8')
 }}}

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/2296>
The Trac Project <http://trac.edgewall.com/>


More information about the Trac-Tickets mailing list