mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
The arguments of EpubBuilder.build_container() is deprecated.
This commit is contained in:
parent
0f972e8bbf
commit
f000df8bfb
3
CHANGES
3
CHANGES
@ -58,7 +58,8 @@ 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()``
|
||||
* The arguments of ``EpubBuilder.build_mimetype()``,
|
||||
``EpubBuilder.build_container()``
|
||||
* The ``encoding`` argument of ``autodoc.Documenter.get_doc()``,
|
||||
``autodoc.DocstringSignatureMixin.get_doc()``,
|
||||
``autodoc.DocstringSignatureMixin._find_signature()``, and
|
||||
|
@ -242,7 +242,8 @@ The following is a list of deprecated interfaces.
|
||||
- 4.0
|
||||
- N/A
|
||||
|
||||
* - arguments of ``EpubBuilder.build_mimetype()``
|
||||
* - arguments of ``EpubBuilder.build_mimetype()``,
|
||||
``EpubBuilder.build_container()``.
|
||||
- 2.0
|
||||
- 4.0
|
||||
- N/A
|
||||
|
@ -485,9 +485,15 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
copy_asset_file(path.join(self.template_dir, 'mimetype'),
|
||||
path.join(outdir, outname))
|
||||
|
||||
def build_container(self, outdir, outname):
|
||||
def build_container(self, outdir=None, outname='META-INF/container.xml'):
|
||||
# type: (str, str) -> None
|
||||
"""Write the metainfo file META-INF/container.xml."""
|
||||
if outdir:
|
||||
warnings.warn('The arguments of EpubBuilder.build_container() is deprecated.',
|
||||
RemovedInSphinx40Warning, stacklevel=2)
|
||||
else:
|
||||
outdir = self.outdir
|
||||
|
||||
logger.info(__('writing %s file...'), outname)
|
||||
filename = path.join(outdir, outname)
|
||||
ensuredir(path.dirname(filename))
|
||||
|
@ -79,7 +79,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
|
||||
self.validate_config_value()
|
||||
self.get_toc()
|
||||
self.build_mimetype()
|
||||
self.build_container(self.outdir, 'META-INF/container.xml')
|
||||
self.build_container()
|
||||
self.build_content(self.outdir, 'content.opf')
|
||||
self.build_navigation_doc(self.outdir, 'nav.xhtml')
|
||||
self.build_toc(self.outdir, 'toc.ncx')
|
||||
|
Loading…
Reference in New Issue
Block a user