summaryrefslogtreecommitdiff
path: root/sphinx/builders/htmlhelp.py
blob: 2e7e8f0831d76ebb8e75a97617d7c605a4853de7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
    sphinx.builders.htmlhelp
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Build HTML help support files.
    Parts adapted from Python's Doc/tools/prechm.py.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

import warnings

from sphinxcontrib.htmlhelp import (
    chm_locales, chm_htmlescape, HTMLHelpBuilder, default_htmlhelp_basename
)

from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias


if False:
    # For type annotation
    from typing import Any, Dict  # NOQA
    from sphinx.application import Sphinx  # NOQA


deprecated_alias('sphinx.builders.devhelp',
                 {
                     'chm_locales': chm_locales,
                     'chm_htmlescape': chm_htmlescape,
                     'HTMLHelpBuilder': HTMLHelpBuilder,
                     'default_htmlhelp_basename': default_htmlhelp_basename,
                 },
                 RemovedInSphinx40Warning)


def setup(app):
    # type: (Sphinx) -> Dict[str, Any]
    warnings.warn('sphinx.builders.htmlhelp has been moved to sphinxcontrib-htmlhelp.',
                  RemovedInSphinx40Warning)
    app.setup_extension('sphinxcontrib.htmlhelp')

    return {
        'version': 'builtin',
        'parallel_read_safe': True,
        'parallel_write_safe': True,
    }