mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
The arguments of EpubBuilder.build_epub() is deprecated.
This commit is contained in:
parent
64533e142c
commit
b6c422ac86
2
CHANGES
2
CHANGES
@ -60,7 +60,7 @@ Deprecated
|
||||
configuration files which should be converted to Python 3.
|
||||
* The arguments of ``EpubBuilder.build_mimetype()``,
|
||||
``EpubBuilder.build_container()``, ``EpubBuilder.bulid_content()``,
|
||||
``EpubBuilder.build_toc()``
|
||||
``EpubBuilder.build_toc()`` and ``EpubBuilder.build_epub()``
|
||||
* The ``encoding`` argument of ``autodoc.Documenter.get_doc()``,
|
||||
``autodoc.DocstringSignatureMixin.get_doc()``,
|
||||
``autodoc.DocstringSignatureMixin._find_signature()``, and
|
||||
|
@ -244,7 +244,7 @@ The following is a list of deprecated interfaces.
|
||||
|
||||
* - arguments of ``EpubBuilder.build_mimetype()``,
|
||||
``EpubBuilder.build_container()``, ``EpubBuilder.build_content()``,
|
||||
``EpubBuilder.build_toc()``
|
||||
``EpubBuilder.build_toc()`` and ``EpubBuilder.build_epub()``
|
||||
- 2.0
|
||||
- 4.0
|
||||
- N/A
|
||||
|
@ -733,13 +733,20 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
path.join(outdir, outname),
|
||||
self.toc_metadata(level, navpoints))
|
||||
|
||||
def build_epub(self, outdir, outname):
|
||||
def build_epub(self, outdir=None, outname=None):
|
||||
# type: (str, str) -> None
|
||||
"""Write the epub file.
|
||||
|
||||
It is a zip file with the mimetype file stored uncompressed as the first
|
||||
entry.
|
||||
"""
|
||||
if outdir:
|
||||
warnings.warn('The arguments of EpubBuilder.build_epub() is deprecated.',
|
||||
RemovedInSphinx40Warning, stacklevel=2)
|
||||
else:
|
||||
outdir = self.outdir
|
||||
outname = self.config.epub_basename + '.epub'
|
||||
|
||||
logger.info(__('writing %s file...'), outname)
|
||||
epub_filename = path.join(outdir, outname)
|
||||
with ZipFile(epub_filename, 'w', ZIP_DEFLATED) as epub:
|
||||
|
@ -83,7 +83,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
|
||||
self.build_content()
|
||||
self.build_navigation_doc(self.outdir, 'nav.xhtml')
|
||||
self.build_toc()
|
||||
self.build_epub(self.outdir, self.config.epub_basename + '.epub')
|
||||
self.build_epub()
|
||||
|
||||
def validate_config_value(self):
|
||||
# type: () -> None
|
||||
|
Loading…
Reference in New Issue
Block a user