當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。