Example #1
0
 def html( self , node, igen, *args, **kwargs ):
     style, text = nowiki2prop( node.text )
     try :
         lexer = get_lexer_by_name( self.lexname )
         code  = highlight( text.strip('\r\n'), lexer, self.formatter )
         html  = self.tmpl % ( style, (self.code_tmpl % code) )
     except:
         if node.parser.etparser.debug : raise
         html = text
     return html
Example #2
0
 def html( self, node, igen, *args, **kwargs ):
     from   eazytext import Translate
     style, text = nowiki2prop( node.text )
     etxconfig = dict( node.parser.etparser.etxconfig.items() )
     etxconfig.update( self.etxconfig )
     html = ''
     if text :
         try :
             t = Translate( etxtext=text, etxconfig=etxconfig )
             html = self.tmpl % ( style, t( context={} ) )
         except :
             raise
             if node.parser.etparser.debug : raise
             html = self.tmpl % ('', '')
     return html
Example #3
0
 def html(self, node, igen, *args, **kwargs):
     from eazytext import Translate
     style, text = nowiki2prop(node.text)
     etxconfig = dict(node.parser.etparser.etxconfig.items())
     etxconfig.update(self.etxconfig)
     html = ''
     if text:
         try:
             t = Translate(etxtext=text, etxconfig=etxconfig)
             html = self.tmpl % (style, t(context={}))
         except:
             raise
             if node.parser.etparser.debug: raise
             html = self.tmpl % ('', '')
     return html
Example #4
0
 def html( self , node, igen, *args, **kwargs ):
     from   eazytext import Translate
     style, text = nowiki2prop( node.text )
     style = style and 'style="%s"' % style
     etxconfig = dict( node.parser.etparser.etxconfig.items() )
     etxconfig.update( self.etxconfig )
     infos = self._parseinfolines( text )
     html = []
     for key, val in infos :
         t = Translate( etxtext=val, etxconfig=etxconfig )
         keyhtml = self.tmpl_k % (key, key)
         valhtml = self.tmpl_v % t( context={} )
         html.append( self.tmpl_kv % '\n'.join( [ keyhtml, valhtml ]) )
     divhtml = self.tmpl_div % '\n'.join(html)
     html = self.tmpl % ( style, divhtml )
     return html
Example #5
0
 def html(self, node, igen, *args, **kwargs):
     from eazytext import Translate
     style, text = nowiki2prop(node.text)
     style = style and 'style="%s"' % style
     etxconfig = dict(node.parser.etparser.etxconfig.items())
     etxconfig.update(self.etxconfig)
     infos = self._parseinfolines(text)
     html = []
     for key, val in infos:
         t = Translate(etxtext=val, etxconfig=etxconfig)
         keyhtml = self.tmpl_k % (key, key)
         valhtml = self.tmpl_v % t(context={})
         html.append(self.tmpl_kv % '\n'.join([keyhtml, valhtml]))
     divhtml = self.tmpl_div % '\n'.join(html)
     html = self.tmpl % (style, divhtml)
     return html