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


Python standalone.Reader方法代码示例

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


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

示例1: publish_secondary_doctree

# 需要导入模块: from docutils.readers import standalone [as 别名]
# 或者: from docutils.readers.standalone import Reader [as 别名]
def publish_secondary_doctree(text, main_tree, source_path):

    # This is a hack so the text substitutions defined
    # in the document are available when we process the cover
    # page. See Issue 322
    dt = main_tree
    # Add substitutions  from the main doctree
    class addSubsts(Transform):
        default_priority = 219

        def apply(self):
            self.document.substitution_defs.update(dt.substitution_defs)
            self.document.substitution_names.update(dt.substitution_names)

    # Use an own reader to modify transformations done.
    class Reader(standalone.Reader):
        def get_transforms(self):
            default = standalone.Reader.get_transforms(self)
            return default + [
                addSubsts,
            ]

    # End of Issue 322 hack

    return docutils.core.publish_doctree(text, reader=Reader(), source_path=source_path) 
开发者ID:rst2pdf,项目名称:rst2pdf,代码行数:27,代码来源:createpdf.py

示例2: get_transforms

# 需要导入模块: from docutils.readers import standalone [as 别名]
# 或者: from docutils.readers.standalone import Reader [as 别名]
def get_transforms(self):
        transforms = standalone.Reader.get_transforms(self)
        # We have PEP-specific frontmatter handling.
        transforms.remove(frontmatter.DocTitle)
        transforms.remove(frontmatter.SectionSubTitle)
        transforms.remove(frontmatter.DocInfo)
        transforms.extend([peps.Headers, peps.Contents, peps.TargetNotes])
        return transforms 
开发者ID:skarlekar,项目名称:faces,代码行数:10,代码来源:pep.py

示例3: __init__

# 需要导入模块: from docutils.readers import standalone [as 别名]
# 或者: from docutils.readers.standalone import Reader [as 别名]
def __init__(self, parser=None, parser_name=None):
        """`parser` should be ``None``."""
        if parser is None:
            parser = rst.Parser(rfc2822=True, inliner=self.inliner_class())
        standalone.Reader.__init__(self, parser, '') 
开发者ID:skarlekar,项目名称:faces,代码行数:7,代码来源:pep.py

示例4: get_transforms

# 需要导入模块: from docutils.readers import standalone [as 别名]
# 或者: from docutils.readers.standalone import Reader [as 别名]
def get_transforms(self):
        default = standalone.Reader.get_transforms(self)
        if self.settings.create_links:
            return default
        return [ i
                 for i in default
                 if i is not references.DanglingReferences ] 
开发者ID:skarlekar,项目名称:faces,代码行数:9,代码来源:__init__.py

示例5: get_transforms

# 需要导入模块: from docutils.readers import standalone [as 别名]
# 或者: from docutils.readers.standalone import Reader [as 别名]
def get_transforms(self):
        """Get default transforms without DocInfo."""
        transforms = standalone.Reader.get_transforms(self)
        transforms.remove(frontmatter.DocInfo)
        return transforms 
开发者ID:SatelliteQE,项目名称:testimony,代码行数:7,代码来源:parser.py

示例6: get_transforms

# 需要导入模块: from docutils.readers import standalone [as 别名]
# 或者: from docutils.readers.standalone import Reader [as 别名]
def get_transforms(self):
        default = standalone.Reader.get_transforms(self)
        if self.settings.create_links:
            return default
        return [i for i in default
                if i is not references.DanglingReferences] 
开发者ID:aws-samples,项目名称:aws-builders-fair-projects,代码行数:8,代码来源:__init__.py


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