Python mistune 模块,BlockLexer() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用mistune.BlockLexer()

项目:slidoc    作者:mitotic    | 项目源码 | 文件源码
def __init__(self, rules=None, **kwargs):
        if rules is None:
            rules = MathBlockGrammar()
        config = kwargs.get('config')
        slidoc_rules = ['block_math', 'latex_environment', 'plugin_definition', 'plugin_embed', 'plugin_insert', 'slidoc_header', 'slidoc_options', 'slidoc_slideopts', 'slidoc_params', 'slidoc_answer', 'slidoc_tags', 'slidoc_hint', 'slidoc_notes', 'slidoc_extra', 'minirule']
        if config and 'incremental_slides' in config.features:
            slidoc_rules += ['pause']
        self.default_rules = slidoc_rules + mistune.BlockLexer.default_rules
        self.slidoc_slide_text = []
        self.slidoc_blocks = []
        self.slidoc_recursion = 0
        self.slidoc_slide_header = None
        super(MathBlockLexer, self).__init__(rules, **kwargs)