@environmentfilter
def asciidoc(env, value):
 try:
  from asciidocapi import AsciiDocAPI
 except ImportError:
  print u'Requires AsciiDoc library to use AsciiDoc tag.'
  raise
 output = value
 asciidoc = AsciiDocAPI()
 asciidoc.options('--no-header-footer')
 result = StringIO()
 asciidoc.execute(StringIO(output.encode('utf-8')), result, backend='html4')
 return str(result.getvalue(), 'utf-8')

@ environmentfilter def asciidoc ( env , value ) : try : from asciidocapi import AsciiDocAPI except ImportError : print u'Requires AsciiDoc library to use AsciiDoc tag.' raise output = value asciidoc = AsciiDocAPI ( ) asciidoc . options ( '--no-header-footer' ) result = StringIO ( ) asciidoc . execute ( StringIO ( output . encode ( 'utf-8' ) ) , result , backend = 'html4' ) return str ( result . getvalue ( ) , 'utf-8' )
asciidoc filter .