The arguments of EpubBuilder.build_content() is deprecated.

This commit is contained in:
Takeshi KOMIYA 2019-01-08 23:45:55 +09:00
parent f000df8bfb
commit d437f39bc4
4 changed files with 10 additions and 4 deletions

View File

@ -59,7 +59,7 @@ Deprecated
* Support for evaluating Python 2 syntax is deprecated. This includes
configuration files which should be converted to Python 3.
* The arguments of ``EpubBuilder.build_mimetype()``,
``EpubBuilder.build_container()``
``EpubBuilder.build_container()``, ``EpubBuilder.bulid_content()``
* The ``encoding`` argument of ``autodoc.Documenter.get_doc()``,
``autodoc.DocstringSignatureMixin.get_doc()``,
``autodoc.DocstringSignatureMixin._find_signature()``, and

View File

@ -243,7 +243,7 @@ The following is a list of deprecated interfaces.
- N/A
* - arguments of ``EpubBuilder.build_mimetype()``,
``EpubBuilder.build_container()``.
``EpubBuilder.build_container()``, ``EpubBuilder.build_content()``
- 2.0
- 4.0
- N/A

View File

@ -519,11 +519,17 @@ class EpubBuilder(StandaloneHTMLBuilder):
metadata['guides'] = []
return metadata
def build_content(self, outdir, outname):
def build_content(self, outdir=None, outname='content.opf'):
# type: (str, str) -> None
"""Write the metainfo file content.opf It contains bibliographic data,
a file list and the spine (the reading order).
"""
if outdir:
warnings.warn('The arguments of EpubBuilder.build_content() is deprecated.',
RemovedInSphinx40Warning, stacklevel=2)
else:
outdir = self.outdir
logger.info(__('writing %s file...'), outname)
metadata = self.content_metadata()

View File

@ -80,7 +80,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
self.get_toc()
self.build_mimetype()
self.build_container()
self.build_content(self.outdir, 'content.opf')
self.build_content()
self.build_navigation_doc(self.outdir, 'nav.xhtml')
self.build_toc(self.outdir, 'toc.ncx')
self.build_epub(self.outdir, self.config.epub_basename + '.epub')