当前位置: 首页>>代码示例>>Python>>正文


Python parser.CommonMarkParser方法代码示例

本文整理汇总了Python中recommonmark.parser.CommonMarkParser方法的典型用法代码示例。如果您正苦于以下问题:Python parser.CommonMarkParser方法的具体用法?Python parser.CommonMarkParser怎么用?Python parser.CommonMarkParser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在recommonmark.parser的用法示例。


在下文中一共展示了parser.CommonMarkParser方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def setup(app):
    app.add_source_suffix('.md', 'markdown')
    app.add_source_parser(CommonMarkParser) 
开发者ID:TOMToolkit,项目名称:tom_base,代码行数:5,代码来源:conf.py

示例2: build_row

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def build_row(item):
    """Return nodes.row with property description"""

    prop, propschema, required = item
    row = nodes.row()

    # Property

    row += nodes.entry("", nodes.paragraph(text=prop), classes=["vl-prop"])

    # Type
    str_type = type_description(propschema)
    par_type = nodes.paragraph()

    is_text = True
    for part in reClassDef.split(str_type):
        if part:
            if is_text:
                add_text(par_type, part)
            else:
                add_class_def(par_type, part)
        is_text = not is_text

    # row += nodes.entry('')
    row += nodes.entry("", par_type)  # , classes=["vl-type-def"]

    # Description
    md_parser = CommonMarkParser()
    # str_descr = "***Required.*** " if required else ""
    str_descr = ""
    str_descr += propschema.get("description", " ")
    doc_descr = utils.new_document("schema_description")
    md_parser.parse(str_descr, doc_descr)

    # row += nodes.entry('', *doc_descr.children, classes="vl-decsr")
    row += nodes.entry("", *doc_descr.children, classes=["vl-decsr"])

    return row 
开发者ID:altair-viz,项目名称:altair,代码行数:40,代码来源:schematable.py

示例3: setup

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def setup(app):
    """Setup the hooks for recommonmark."""
    app.add_config_value('recommonmark_config', {
        # 'url_resolver': lambda url: github_doc_root + url,
        'auto_toc_tree_section': 'Contents',
        'enable_eval_rst': True,
    }, True)
    app.add_source_parser(CommonMarkParser)
    app.add_transform(AutoStructify) 
开发者ID:pacifica,项目名称:python-jsonpath2,代码行数:11,代码来源:conf.py

示例4: cm2html

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def cm2html():
    description = ('Generate html document from markdown sources. ' + default_description)
    publish_cmdline(writer_name='html',
                    parser=CommonMarkParser(),
                    description=description) 
开发者ID:readthedocs,项目名称:recommonmark,代码行数:7,代码来源:scripts.py

示例5: cm2man

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def cm2man():
    description = ('Generate a manpage from markdown sources. ' + default_description)
    publish_cmdline(writer_name='manpage',
                    parser=CommonMarkParser(),
                    description=description) 
开发者ID:readthedocs,项目名称:recommonmark,代码行数:7,代码来源:scripts.py

示例6: cm2xml

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def cm2xml():
    description = ('Generate XML document from markdown sources. ' + default_description)
    publish_cmdline(writer_name='xml',
                    parser=CommonMarkParser(),
                    description=description) 
开发者ID:readthedocs,项目名称:recommonmark,代码行数:7,代码来源:scripts.py

示例7: cm2pseudoxml

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def cm2pseudoxml():
    description = ('Generate pseudo-XML document from markdown sources. ' + default_description)
    publish_cmdline(writer_name='pseudoxml',
                    parser=CommonMarkParser(),
                    description=description) 
开发者ID:readthedocs,项目名称:recommonmark,代码行数:7,代码来源:scripts.py

示例8: cm2latex

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def cm2latex():
    description = ('Generate latex document from markdown sources. ' + default_description)
    publish_cmdline(writer_name='latex',
                    parser=CommonMarkParser(),
                    description=description) 
开发者ID:readthedocs,项目名称:recommonmark,代码行数:7,代码来源:scripts.py

示例9: assertParses

# 需要导入模块: from recommonmark import parser [as 别名]
# 或者: from recommonmark.parser import CommonMarkParser [as 别名]
def assertParses(self, source, expected, alt=False):  # noqa
        parser = CommonMarkParser()
        parser.parse(dedent(source), new_document('<string>'))
        self.maxDiff = None
        self.assertMultiLineEqual(
            dedent(expected).lstrip(),
            dedent(parser.document.asdom().toprettyxml(indent='  ')),
        ) 
开发者ID:readthedocs,项目名称:recommonmark,代码行数:10,代码来源:test_basic.py


注:本文中的recommonmark.parser.CommonMarkParser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。