Python docutils.nodes 模块,math() 实例源码

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

项目:aws-cfn-plex    作者:lordmuffin    | 项目源码 | 文件源码
def get_tokens(self, txtnodes):
        # A generator that yields ``(texttype, nodetext)`` tuples for a list
        # of "Text" nodes (interface to ``smartquotes.educate_tokens()``).

        texttype = {True: 'literal', # "literal" text is not changed:
                    False: 'plain'}
        for txtnode in txtnodes:
            nodetype = texttype[isinstance(txtnode.parent,
                                           (nodes.literal,
                                            nodes.math,
                                            nodes.image,
                                            nodes.raw,
                                            nodes.problematic))]
            yield (nodetype, txtnode.astext())
项目:aws-cfn-plex    作者:lordmuffin    | 项目源码 | 文件源码
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
    set_classes(options)
    i = rawtext.find('`')
    text = rawtext.split('`')[1]
    node = nodes.math(rawtext, text, **options)
    return [node], []
项目:AshsSDK    作者:thehappydinoa    | 项目源码 | 文件源码
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
    set_classes(options)
    i = rawtext.find('`')
    text = rawtext.split('`')[1]
    node = nodes.math(rawtext, text, **options)
    return [node], []
项目:chalktalk_docs    作者:loremIpsum1771    | 项目源码 | 文件源码
def get_tokens(self, txtnodes):
        # A generator that yields ``(texttype, nodetext)`` tuples for a list
        # of "Text" nodes (interface to ``smartquotes.educate_tokens()``).

        texttype = {True: 'literal', # "literal" text is not changed:
                    False: 'plain'}
        for txtnode in txtnodes:
            nodetype = texttype[isinstance(txtnode.parent,
                                           (nodes.literal,
                                            nodes.math,
                                            nodes.image,
                                            nodes.raw,
                                            nodes.problematic))]
            yield (nodetype, txtnode.astext())
项目:chalktalk_docs    作者:loremIpsum1771    | 项目源码 | 文件源码
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
    i = rawtext.find('`')
    text = rawtext.split('`')[1]
    node = nodes.math(rawtext, text)
    return [node], []
项目:blackmamba    作者:zrzka    | 项目源码 | 文件源码
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
    set_classes(options)
    i = rawtext.find('`')
    text = rawtext.split('`')[1]
    node = nodes.math(rawtext, text, **options)
    return [node], []
项目:RST-vscode    作者:tht13    | 项目源码 | 文件源码
def get_tokens(self, txtnodes):
        # A generator that yields ``(texttype, nodetext)`` tuples for a list
        # of "Text" nodes (interface to ``smartquotes.educate_tokens()``).

        texttype = {True: 'literal', # "literal" text is not changed:
                    False: 'plain'}
        for txtnode in txtnodes:
            nodetype = texttype[isinstance(txtnode.parent,
                                           (nodes.literal,
                                            nodes.math,
                                            nodes.image,
                                            nodes.raw,
                                            nodes.problematic))]
            yield (nodetype, txtnode.astext())
项目:RST-vscode    作者:tht13    | 项目源码 | 文件源码
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
    set_classes(options)
    i = rawtext.find('`')
    text = rawtext.split('`')[1]
    node = nodes.math(rawtext, text, **options)
    return [node], []
项目:tf_aws_ecs_instance_draining_on_scale_in    作者:terraform-community-modules    | 项目源码 | 文件源码
def get_tokens(self, txtnodes):
        # A generator that yields ``(texttype, nodetext)`` tuples for a list
        # of "Text" nodes (interface to ``smartquotes.educate_tokens()``).

        texttype = {True: 'literal', # "literal" text is not changed:
                    False: 'plain'}
        for txtnode in txtnodes:
            nodetype = texttype[isinstance(txtnode.parent,
                                           (nodes.literal,
                                            nodes.math,
                                            nodes.image,
                                            nodes.raw,
                                            nodes.problematic))]
            yield (nodetype, txtnode.astext())
项目:tf_aws_ecs_instance_draining_on_scale_in    作者:terraform-community-modules    | 项目源码 | 文件源码
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
    set_classes(options)
    i = rawtext.find('`')
    text = rawtext.split('`')[1]
    node = nodes.math(rawtext, text, **options)
    return [node], []