The arguments of Epub3Builder.build_navigation_doc() is deprecated.

This commit is contained in:
Takeshi KOMIYA 2019-01-08 23:46:00 +09:00
parent b6c422ac86
commit e82f5ddb55
3 changed files with 16 additions and 2 deletions

View File

@ -61,6 +61,7 @@ Deprecated
* The arguments of ``EpubBuilder.build_mimetype()``,
``EpubBuilder.build_container()``, ``EpubBuilder.bulid_content()``,
``EpubBuilder.build_toc()`` and ``EpubBuilder.build_epub()``
* The arguments of ``Epub3Builder.build_navigation_doc()``
* The ``encoding`` argument of ``autodoc.Documenter.get_doc()``,
``autodoc.DocstringSignatureMixin.get_doc()``,
``autodoc.DocstringSignatureMixin._find_signature()``, and

View File

@ -249,6 +249,11 @@ The following is a list of deprecated interfaces.
- 4.0
- N/A
* - arguments of ``Epub3Builder.build_navigation_doc()``
- 2.0
- 4.0
- N/A
* - ``nodetype`` argument of
``sphinx.search.WordCollector.is_meta_keywords()``
- 2.0

View File

@ -9,12 +9,14 @@
:license: BSD, see LICENSE for details.
"""
import warnings
from collections import namedtuple
from os import path
from sphinx import package_dir
from sphinx.builders import _epub_base
from sphinx.config import ENUM
from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.locale import __
from sphinx.util import logging, xmlname_checker
from sphinx.util.fileutil import copy_asset_file
@ -81,7 +83,7 @@ class Epub3Builder(_epub_base.EpubBuilder):
self.build_mimetype()
self.build_container()
self.build_content()
self.build_navigation_doc(self.outdir, 'nav.xhtml')
self.build_navigation_doc()
self.build_toc()
self.build_epub()
@ -202,9 +204,15 @@ class Epub3Builder(_epub_base.EpubBuilder):
metadata['navlist'] = navlist
return metadata
def build_navigation_doc(self, outdir, outname):
def build_navigation_doc(self, outdir=None, outname='nav.xhtml'):
# type: (str, str) -> None
"""Write the metainfo file nav.xhtml."""
if outdir:
warnings.warn('The arguments of Epub3Builder.build_navigation_doc() '
'is deprecated.', RemovedInSphinx40Warning, stacklevel=2)
else:
outdir = self.outdir
logger.info(__('writing %s file...'), outname)
if self.config.epub_tocscope == 'default':