コード例 #1
0
    def __init__(self, pattern, config, latex2svg, md):
        """Initialize."""

        self.inline_class = config.get('inline_class', '')
        self.latex2svg = latex2svg

        InlineProcessor.__init__(self, pattern, md)
コード例 #2
0
    def __init__(self, pattern, config, md):
        """Initialize."""

        self.config = config
        InlineProcessor.__init__(self, pattern, md)
        self.md = md

        self.formatters = [{
            "name": "inlinehilite",
            "test": _test,
            "formatter": self.highlight_code
        }]

        # Custom Fences
        custom_inline = self.config.get('custom_inline', [])
        for custom in custom_inline:
            name = custom.get('name')
            class_name = custom.get('class')
            inline_format = custom.get('format', self.highlight_code)
            if name is not None and class_name is not None:
                self.extend_custom_inline(
                    name,
                    functools.partial(_formatter,
                                      class_name=class_name,
                                      fmt=inline_format))

        self.get_hl_settings = False
コード例 #3
0
ファイル: magiclink.py プロジェクト: poojakancherla/Stray-Aid
    def __init__(self, pattern, md, user, repo, provider, labels):
        """Initialize."""

        self.user = user
        self.repo = repo
        self.labels = labels
        self.provider = provider if provider in PROVIDER_INFO else ''
        InlineProcessor.__init__(self, pattern, md)
コード例 #4
0
ファイル: arithmatex.py プロジェクト: CarlosForever/dotfiles
    def __init__(self, pattern, config):
        """Initialize."""

        # Generic setup
        self.generic = config.get('generic', False)
        wrap = config.get('tex_inline_wrap', ["\\(", "\\)"])
        self.wrap = wrap[0] + '%s' + wrap[1]

        # Default setup
        self.preview = config.get('preview', True)
        InlineProcessor.__init__(self, pattern)
コード例 #5
0
    def __init__(self, pattern, config):
        """Initialize."""

        # Generic setup
        self.generic = config.get('generic', False)
        wrap = config.get('tex_inline_wrap', ["\\(", "\\)"])
        self.wrap = wrap[0] + '%s' + wrap[1]

        # Default setup
        self.preview = config.get('preview', True)
        InlineProcessor.__init__(self, pattern)
コード例 #6
0
    def __init__(self, pattern, config):
        """Initialize."""

        # Generic setup
        self.generic = config.get('generic', False)
        wrap = config.get('tex_inline_wrap', ["\\(", "\\)"])
        self.wrap = (wrap[0].replace('{', '}}').replace('}', '}}') + '{}' +
                     wrap[1].replace('{', '}}').replace('}', '}}'))
        self.inline_tag = config.get('inline_tag', 'span')

        # Default setup
        self.preview = config.get('preview', True)
        InlineProcessor.__init__(self, pattern)
コード例 #7
0
ファイル: emoji.py プロジェクト: ostapenkov10/sphinx-test
    def __init__(self, pattern, config, md):
        """Initialize."""

        InlineProcessor.__init__(self, pattern, md)

        title = config['title']
        alt = config['alt']
        self.options = config['options']
        self._set_index(config["emoji_index"])
        self.unicode_alt = alt in UNICODE_ALT
        self.encoded_alt = alt == UNICODE_ENTITY
        self.remove_var_sel = config['remove_variation_selector']
        self.title = title if title in VALID_TITLE else NO_TITLE
        self.generator = config['emoji_generator']
コード例 #8
0
    def __init__(self, pattern, config, md):
        """Initialize."""

        title = config['title']
        alt = config['alt']

        self._set_index(config["emoji_index"])
        self.unicode_alt = alt in UNICODE_ALT
        self.encoded_alt = alt == UNICODE_ENTITY
        self.remove_var_sel = config['remove_variation_selector']
        self.title = title if title in VALID_TITLE else NO_TITLE
        self.generator = config['emoji_generator']
        self.options = config['options']
        InlineProcessor.__init__(self, pattern, md)
コード例 #9
0
ファイル: cumd.py プロジェクト: ENDrain/cumd
 def __init__(self):
     InlineProcessor.__init__(self, r'\^(' + RE_CU_LETTER + ')')
コード例 #10
0
 def __init__(self, pattern):
     InlineProcessor.__init__(self, pattern)
     self.ESCAPED_BSLASH = '{}{}{}'.format(util.STX, ord('\\'), util.ETX)
     self.tag = 'tt'
コード例 #11
0
ファイル: typehint.py プロジェクト: mghweb/pymdown-typehint
    def __init__(self, pattern, md, config):

        self.config = config

        InlineProcessor.__init__(self, pattern, md)
コード例 #12
0
    def __init__(self, pattern, md):
        """Initialize."""

        InlineProcessor.__init__(self, pattern, md)
コード例 #13
0
    def __init__(self, pattern, nbsp):
        """Initialize."""

        self.nbsp = nbsp
        InlineProcessor.__init__(self, pattern)
コード例 #14
0
 def __init__(self, pattern, config):
     self.profile = config.get("profile", False)[0]
     InlineProcessor.__init__(self, pattern)
コード例 #15
0
    def __init__(self, pattern, md):
        """Initialize."""

        InlineProcessor.__init__(self, pattern, md)
コード例 #16
0
ファイル: cumd.py プロジェクト: ENDrain/cumd
 def __init__(self):
     InlineProcessor.__init__(self, r'<<(\d+)(?::\s*([^>)]+))?>>')
コード例 #17
0
ファイル: cumd.py プロジェクト: ENDrain/cumd
 def __init__(self):
     InlineProcessor.__init__(self, r'\+(\S|\S.*?\S)\+')
コード例 #18
0
ファイル: cumd.py プロジェクト: ENDrain/cumd
 def __init__(self):
     InlineProcessor.__init__(self, r'\({2}\s*(.+?)\s*\){2}')