Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Return a wraper function that removes non-alnum markup before
calling render_funct().

Some rendering engines are incompatible with Gazest internal
representation.  Instead of hacking a new internal representation
for every possible renderer, this function re-tags the text to
render with alnum only markup.  This can't possibly clash since
the resulting markup look like perfectly normal prose but it is
inefficient so we only use it with renderers that do clash.

        def make_adapter(render_funct):
    """ Return a wraper function that removes non-alnum markup before
    calling render_funct().

    Some rendering engines are incompatible with Gazest internal
    representation.  Instead of hacking a new internal representation
    for every possible renderer, this function re-tags the text to
    render with alnum only markup.  This can't possibly clash since
    the resulting markup look like perfectly normal prose but it is
    inefficient so we only use it with renderers that do clash."""

    def wrapper(body):
    
        omrk = find_marker(body)
        body = body.replace("[[[", omrk)
        cmrk = find_marker(body)
        body = body.replace("]]]", cmrk)

        body = render_funct(body)

        body = body.replace(omrk, "[[[")
        body = body.replace(cmrk, "]]]")
        return body

    return wrapper
        


src/g/a/gazest_extra_macros-0.3.1/gazest_extra_macros/bbcode.py   gazest-extra-macros(Download)
def enable(page, val):
    # we import only now because support is optional
    from gazest_extra_macros import postmarkup
    from util import make_adapter
 
    page.html_renderer = make_adapter(postmarkup.render_bbcode)

src/g/a/gazest_extra_macros-0.3.1/gazest_extra_macros/asciidoc_macros.py   gazest-extra-macros(Download)
def enable(page, val):
    # we import only now because support is optional
    asciidoc_mod = __import__('asciidoc.asciidoc')
    from util import make_adapter
 
        return dst.read()
 
    page.html_renderer = make_adapter(render)
    return ""