<filename>2012/plugins_python/plugins/tt.py<gh_stars>1000+
#-------------------------------------------------------------------------------
# htmlize: plugin/tt.py
#
# A htmlize plugin that handles the "tt" role.
#
# <NAME> (<EMAIL>)
# This code is in the public domain
#-------------------------------------------------------------------------------
from htmlize.iplugin import IPlugin


class TtFormatter(IPlugin):
    """ Acts on the 'tt' role, placing the contents inside <tt> tags.
    """
    def get_role_hook(self, role_name):
        return self._tt_hook if role_name == 'tt' else None

    def _tt_hook(self, contents):
        return '<tt>' + contents + '</tt>'

<filename>2012/plugins_python/plugins/tt.py<gh_stars>1000+
#-------------------------------------------------------------------------------
# htmlize: plugin/tt.py
#
# A htmlize plugin that handles the "tt" role.
#
# <NAME> (<EMAIL>)
# This code is in the public domain
#-------------------------------------------------------------------------------
from htmlize.iplugin import IPlugin


class TtFormatter(IPlugin):
    """ Acts on the 'tt' role, placing the contents inside <tt> tags.
    """
    def get_role_hook(self, role_name):
        return self._tt_hook if role_name == 'tt' else None

    def _tt_hook(self, contents):
        return '<tt>' + contents + '</tt>'

#------------------------------------------------------------------------------- # htmlize: plugin/tt.py # # A htmlize plugin that handles the "tt" role. # # <NAME> (<EMAIL>) # This code is in the public domain #------------------------------------------------------------------------------- Acts on the 'tt' role, placing the contents inside <tt> tags.