當前位置: 首頁>>代碼示例>>Python>>正文


Python writers.Writer方法代碼示例

本文整理匯總了Python中docutils.writers.Writer方法的典型用法代碼示例。如果您正苦於以下問題:Python writers.Writer方法的具體用法?Python writers.Writer怎麽用?Python writers.Writer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在docutils.writers的用法示例。


在下文中一共展示了writers.Writer方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: assemble_my_parts

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def assemble_my_parts(self):
        """Assemble the `self.parts` dictionary.  Extend in subclasses.
        """
        writers.Writer.assemble_parts(self)
        f = tempfile.NamedTemporaryFile()
        zfile = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED)
        self.write_zip_str(zfile, 'mimetype', self.MIME_TYPE,
            compress_type=zipfile.ZIP_STORED)
        content = self.visitor.content_astext()
        self.write_zip_str(zfile, 'content.xml', content)
        s1 = self.create_manifest()
        self.write_zip_str(zfile, 'META-INF/manifest.xml', s1)
        s1 = self.create_meta()
        self.write_zip_str(zfile, 'meta.xml', s1)
        s1 = self.get_stylesheet()
        self.write_zip_str(zfile, 'styles.xml', s1)
        self.store_embedded_files(zfile)
        self.copy_from_stylesheet(zfile)
        zfile.close()
        f.seek(0)
        whole = f.read()
        f.close()
        self.parts['whole'] = whole
        self.parts['encoding'] = self.document.settings.output_encoding
        self.parts['version'] = docutils.__version__ 
開發者ID:skarlekar,項目名稱:faces,代碼行數:27,代碼來源:__init__.py

示例2: __init__

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def __init__(self, builder=None):
        writers.Writer.__init__(self)
        self.builder = builder 
開發者ID:codejamninja,項目名稱:sphinx-markdown-builder,代碼行數:5,代碼來源:doctree2md.py

示例3: __init__

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def __init__(self):
        writers.Writer.__init__(self) 
開發者ID:skarlekar,項目名稱:faces,代碼行數:4,代碼來源:textwriter.py

示例4: __init__

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def __init__(self):
        writers.Writer.__init__(self)
        self.translator_class = ODFTranslator 
開發者ID:skarlekar,項目名稱:faces,代碼行數:5,代碼來源:__init__.py

示例5: __init__

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def __init__(self):
        writers.Writer.__init__(self)
        self.translator_class = Translator 
開發者ID:skarlekar,項目名稱:faces,代碼行數:5,代碼來源:manpage.py

示例6: __init__

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def __init__(self):
        writers.Writer.__init__(self)
        self.translator_class = XMLTranslator 
開發者ID:skarlekar,項目名稱:faces,代碼行數:5,代碼來源:docutils_xml.py

示例7: assemble_parts

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def assemble_parts(self):
        writers.Writer.assemble_parts(self)
        for part in self.visitor_attributes:
            self.parts[part] = ''.join(getattr(self, part)) 
開發者ID:skarlekar,項目名稱:faces,代碼行數:6,代碼來源:_html_base.py

示例8: __init__

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def __init__(self):
        writers.Writer.__init__(self)
        self.translator_class = LaTeXTranslator

    # Override parent method to add latex-specific transforms 
開發者ID:skarlekar,項目名稱:faces,代碼行數:7,代碼來源:__init__.py

示例9: get_transforms

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def get_transforms(self):
       return writers.Writer.get_transforms(self) + [
       # Convert specific admonitions to generic one
       writer_aux.Admonitions,
       # TODO: footnote collection transform
       ] 
開發者ID:skarlekar,項目名稱:faces,代碼行數:8,代碼來源:__init__.py

示例10: assemble_parts

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def assemble_parts(self):
        """Assemble the `self.parts` dictionary of output fragments."""
        writers.Writer.assemble_parts(self)
        for part in self.visitor_attributes:
            lines = getattr(self, part)
            if part in self.head_parts:
                if lines:
                    lines.append('') # to get a trailing newline
                self.parts[part] = '\n'.join(lines)
            else:
                # body contains inline elements, so join without newline
                self.parts[part] = ''.join(lines) 
開發者ID:skarlekar,項目名稱:faces,代碼行數:14,代碼來源:__init__.py

示例11: __init__

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def __init__(self, builder):
        writers.Writer.__init__(self)
        self.builder = builder 
開發者ID:sphinx-contrib,項目名稱:restbuilder,代碼行數:5,代碼來源:rst.py

示例12: get_transforms

# 需要導入模塊: from docutils import writers [as 別名]
# 或者: from docutils.writers import Writer [as 別名]
def get_transforms(self):
        return writers.Writer.get_transforms(self) + [writer_aux.Admonitions] 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:4,代碼來源:_html_base.py


注:本文中的docutils.writers.Writer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。