Debian Codegraph @

docs/conf.py

raw
1 import os
2 import sys
3
4 try:
5 import furo
6 except ImportError:
7 furo = None
8 try:
9 import rst.linker as rst_linker
10 except ImportError:
11 rst_linker = None
12
13 # Use the source tree.
14 sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
15
16 extensions = [
17 'sphinx.ext.autodoc',
18 'sphinx.ext.doctest',
19 'sphinx.ext.todo',
20 'sphinx.ext.coverage',
21 ]
22
23 project = 'jsonpickle'
24 master_doc = 'index'
25
26 if furo is not None:
27 html_theme = 'furo'
28
29 # Link dates and other references in the changelog
30 if rst_linker is not None:
31 extensions += ['rst.linker']
32
33 package_url = 'https://github.com/jsonpickle/jsonpickle'
34 link_files = {
35 '../CHANGES.rst': dict(
36 using=dict(GH='https://github.com'),
37 replace=[
38 dict(
39 pattern=r'(Issue #|\B#)(?P<issue>\d+)',
40 url=package_url + '/issues/{issue}',
41 ),
42 dict(
43 pattern=r'\B\+(?P<pull>\d+)',
44 url=package_url + '/pull/{pull}',
45 ),
46 dict(
47 pattern=r'(?m:^((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n)',
48 with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
49 ),
50 dict(
51 pattern=r'PEP[- ](?P<pep_number>\d+)',
52 url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
53 ),
54 ],
55 )
56 }
57
58 # Be strict about any broken references
59 nitpicky = True
60
61 sphinx_disable = os.environ.get('JSONPICKLE_SPHINX_DISABLE', '')
62 if 'intersphinx' not in sphinx_disable:
63 extensions += ['sphinx.ext.intersphinx']
64 intersphinx_mapping = {
65 'python': ('https://docs.python.org/3', None),
66 'sphinx': ('https://www.sphinx-doc.org/en/stable/', None),
67 }
68
69 # Preserve authored syntax for defaults
70 autodoc_preserve_defaults = True