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