File: conf.py

package info (click to toggle)
python-djvulibre 0.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 648 kB
  • sloc: python: 2,437; makefile: 38; sh: 25
file content (70 lines) | stat: -rw-r--r-- 2,148 bytes parent folder | download | duplicates (2)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright © 2009-2021 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2022-2024 FriedrichFröbel
#
# This file is part of djvulibre-python.
#
# djvulibre-python is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# djvulibre-python is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.doctest',
    'sphinx.ext.todo',
    'sphinx.ext.coverage',
    'sphinx.ext.inheritance_diagram',
]

templates_path = ['templates']
source_suffix = '.rst'
source_encoding = 'UTF-8'
master_doc = 'index'

try:
    import setup as _setup  # noqa: E402
    project = _setup.setup_params['name']
    version = release = _setup.py_version
except ImportError:
    from importlib.metadata import version as _version
    project = 'djvulibre-python'
    version = _version(project)

pygments_style = 'sphinx'

html_theme = 'haiku'
html_use_modindex = True
html_use_index = False
html_show_copyright = False
html_show_sphinx = False
html_static_path = ['static']

rst_epilog = '''
.. |djvu3ref| replace:: Lizardtech DjVu Reference
.. _djvu3ref: http://djvu.org/docs/DjVu3Spec.djvu

.. |djvused| replace:: djvused manual
.. _djvused: http://djvu.sourceforge.net/doc/man/djvused.html

.. |djvuext| replace:: Actual and proposed changes to the DjVu format
.. _djvuext: https://sourceforge.net/p/djvu/djvulibre-git/ci/release.3.5.23/tree/doc/djvuchanges.txt
'''

# With a bit of our help, docutils is capable of rendering our simple formulas.
# Sphinx math extension is not needed.
import sphinx.writers.html  # noqa: E402
del sphinx.writers.html.HTMLTranslator.visit_math


def setup(app):
    try:
        # added in Sphinx 1.8
        add_css_file = app.add_css_file
    except AttributeError:
        # deprecated in Sphinx 1.8, removed in 4.0
        add_css_file = app.add_stylesheet
    add_css_file('docutils-math.css')