本文整理汇总了Python中docutils.frontend.OptionParser.output_encoding方法的典型用法代码示例。如果您正苦于以下问题:Python OptionParser.output_encoding方法的具体用法?Python OptionParser.output_encoding怎么用?Python OptionParser.output_encoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类docutils.frontend.OptionParser
的用法示例。
在下文中一共展示了OptionParser.output_encoding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from docutils.frontend import OptionParser [as 别名]
# 或者: from docutils.frontend.OptionParser import output_encoding [as 别名]
def __init__(self, document, docstring_linker):
# Set the document's settings.
if self.settings is None:
settings = OptionParser([LaTeXWriter()]).get_default_values()
settings.output_encoding = 'utf-8'
self.__class__.settings = settings
document.settings = self.settings
LaTeXTranslator.__init__(self, document)
self._linker = docstring_linker
# Start at section level 3. (Unfortunately, we now have to
# set a private variable to make this work; perhaps the standard
# latex translator should grow an official way to spell this?)
self.section_level = 3
self._section_number = [0]*self.section_level
示例2: __init__
# 需要导入模块: from docutils.frontend import OptionParser [as 别名]
# 或者: from docutils.frontend.OptionParser import output_encoding [as 别名]
def __init__(self, document, docstring_linker=None, directory=None,
docindex=None, context=None):
# Set the document's settings.
if self.settings is None:
settings = OptionParser([LaTeXWriter()]).get_default_values()
settings.output_encoding = 'utf-8'
# This forces eg \EpydocUserSection rather than
# \EpydocUserSEction*:
settings.use_latex_toc = True
self.__class__.settings = settings
document.settings = self.settings
LaTeXTranslator.__init__(self, document)
self._linker = docstring_linker
self._directory = directory
self._docindex = docindex
self._context = context
# Use custom section names.
self.d_class = _EpydocDocumentClass()