本文整理匯總了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()