Пример #1
0
 def __init__(self, parser):
     NodeParser.__init__(self, parser)
     lang = parser.defaults['doc-parser-lang']
     style = parser.defaults['doc-parser-style']
     self.parser_name = '%s.parser.%s' % (lang, style)
     self.lexor_parser = core.Parser(lang, style)
     try:
         self.lexor_parser.load_node_parsers()
     except ImportError:
         self.lexor_parser = None
     self.indentation = 0
     self.line_start = 0
Пример #2
0
    def __init__(self, parser):
        """To be able to use the this class you need to derive a node
        parser from this abstract class. You only need to overload
        this method and define the following:

            self.parser = parser
            self.pattern = None
            self.tight = True  # No separation <pattern>text<pattern>
            self.tagname = None

        For instance: ("**", True, "strong") will transform

            `**strong**` into <strong>strong</strong>

        but not `**strong **`.
        """
        NodeParser.__init__(self, parser)
        self.pattern = None
        self.tight = True
        self.tagname = None
Пример #3
0
    def __init__(self, parser):
        """To be able to use the this class you need to derive a node
        parser from this abstract class. You only need to overload
        this method and define the following:

            self.parser = parser
            self.pattern = None
            self.tight = True  # No separation <pattern>text<pattern>
            self.tagname = None

        For instance: ("**", True, "strong") will transform

            `**strong**` into <strong>strong</strong>

        but not `**strong **`.
        """
        NodeParser.__init__(self, parser)
        self.pattern = None
        self.tight = True
        self.tagname = None