File: conf.py

package info (click to toggle)
python-simple-pid 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 200 kB
  • sloc: python: 394; makefile: 9
file content (68 lines) | stat: -rw-r--r-- 1,800 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
67
68
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

import os
import sys
sys.path.insert(0, os.path.abspath('../../'))


# -- Project information -----------------------------------------------------

project = 'simple-pid'
copyright = '2018-2023, Martin Lundberg'
author = 'Martin Lundberg'

# Extract version from pyproject.toml
with open('../../pyproject.toml', 'r') as f:
    for line in f:
        if line.startswith('version'):
            release = line.split('"')[1]
            version = release


# -- General configuration ---------------------------------------------------

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.viewcode',
    'sphinx_copybutton',
    'myst_parser',
]

templates_path = ['_templates']
root_doc = 'index'
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_dark_style = 'nord'


# -- Options for HTML output -------------------------------------------------

html_theme = 'furo'
html_static_path = ['_static']
html_title = f'{project} {release}'


# -- Extension configuration -------------------------------------------------

# autoclass_content = 'both'
autodoc_class_signature = 'separated'
autodoc_member_order = 'bysource'
autodoc_typehints = 'description'
autodoc_typehints_description_target = 'documented'

def autodoc_skip_member(app, what, name, obj, skip, options):
    # Include __call__ in docs
    if name in ['__call__']:
        return False
    return skip

def setup(app):
    app.connect('autodoc-skip-member', autodoc_skip_member)