File: conf.py

package info (click to toggle)
pymodbus 3.8.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,720 kB
  • sloc: python: 14,867; makefile: 27; sh: 17
file content (66 lines) | stat: -rw-r--r-- 1,770 bytes parent folder | download
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
"""Document configuration."""
#
# PyModbus documentation build configuration file,
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# pylint: skip-file
import os
import sys

from recommonmark.transform import AutoStructify

from pymodbus import __version__ as pymodbus_version


# -- General configuration ------------------------------------------------
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.extlinks",
    "sphinx_rtd_theme",
    "sphinx.ext.autosectionlabel"
]
source_suffix = {'.rst': 'restructuredtext'}
root_doc = "index"
project = "PyModbus"
copyright = "See license"
author = "Open Source volunteers"
if "dev" in pymodbus_version:
    version = "dev"
else:
    version = "v" + pymodbus_version
release = pymodbus_version
language = "en"
exclude_patterns = ["build", "Thumbs.db", ".DS_Store"]
pygments_style = "sphinx"
todo_include_todos = False

# -- Options for HTML output ----------------------------------------------
html_theme = "sphinx_rtd_theme"
html_static_path = []
html_sidebars = {
    "**": [
        "relations.html",  # needs "show_related": True theme option to display
        "searchbox.html",
    ]
}

# -- Specials ----------------------------------------------
parent_dir = os.path.abspath(os.pardir)
sys.path.insert(0, parent_dir)
sys.path.append(os.path.join(parent_dir, "examples"))
github = f"https://github.com/pymodbus-dev/pymodbus/blob/{version}/"
extlinks = {'github': (github + '%s', '%s')}

def setup(app):
    """Do setup."""
    app.add_config_value(
        "recommonmark_config",
        {
            "url_resolver": lambda url: github + "doc/" + url,
            "auto_toc_tree_section": "Contents",
        },
        True,
    )
    app.add_transform(AutoStructify)