|
1 | 1 | """Sphinx Configuration File.""" |
2 | 2 |
|
3 | | -import datetime |
4 | 3 | import os |
5 | 4 | import pathlib |
6 | 5 | import sys |
| 6 | + |
7 | 7 | import toml |
8 | 8 |
|
9 | | -sys.path.insert(0, os.path.abspath('../')) |
| 9 | +sys.path.insert(0, os.path.abspath("../")) |
10 | 10 |
|
11 | 11 |
|
12 | 12 | # -- General configuration ------------------------------------------------ |
13 | 13 |
|
14 | | -extensions = ['sphinx.ext.autodoc', |
15 | | - 'sphinx.ext.coverage', |
16 | | - 'sphinx.ext.viewcode', |
17 | | - 'sphinx.ext.napoleon'] |
| 14 | +extensions = [ |
| 15 | + "sphinx.ext.autodoc", |
| 16 | + "sphinx.ext.coverage", |
| 17 | + "sphinx.ext.intersphinx", |
| 18 | + "sphinx.ext.napoleon", |
| 19 | + "sphinx.ext.viewcode", |
| 20 | +] |
18 | 21 |
|
19 | | -source_suffix = '.rst' |
| 22 | +source_suffix = ".rst" |
20 | 23 |
|
21 | | -master_doc = 'index' |
| 24 | +master_doc = "index" |
22 | 25 |
|
23 | 26 | root_path = pathlib.Path(__file__).parent.parent |
24 | 27 | pyproj_file = root_path / "pyproject.toml" |
|
27 | 30 | project = proj_config["tool"]["poetry"]["name"] |
28 | 31 | company = "National Instruments" |
29 | 32 | author = company |
30 | | -copyright = f"{datetime.datetime.now().year}, {company}" |
| 33 | +copyright = f"2017-%Y, {company}" |
31 | 34 |
|
32 | 35 | # Release is the full version, version is only the major component |
33 | 36 | release = proj_config["tool"]["poetry"]["version"] |
34 | 37 | version = ".".join(release.split(".")[:2]) |
35 | 38 | description = proj_config["tool"]["poetry"]["description"] |
36 | 39 |
|
37 | | -language = 'en' |
| 40 | +language = "en" |
38 | 41 |
|
39 | | -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 42 | +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
40 | 43 |
|
41 | | -pygments_style = 'sphinx' |
| 44 | +pygments_style = "sphinx" |
42 | 45 |
|
43 | 46 | todo_include_todos = False |
44 | 47 |
|
| 48 | +intersphinx_mapping = { |
| 49 | + "grpc": ("https://grpc.github.io/grpc/python/", None), |
| 50 | + "numpy": ("https://numpy.org/doc/stable/", None), |
| 51 | + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), |
| 52 | + "python": ("https://docs.python.org/3", None), |
| 53 | +} |
45 | 54 |
|
46 | 55 | # -- Options for HTML output ---------------------------------------------- |
47 | 56 |
|
48 | | -html_theme = 'sphinx_rtd_theme' |
| 57 | +html_theme = "sphinx_rtd_theme" |
49 | 58 |
|
50 | 59 | html_static_path = [] |
51 | 60 |
|
52 | 61 |
|
53 | 62 | # -- Options for HTMLHelp output ------------------------------------------ |
54 | 63 |
|
55 | | -htmlhelp_basename = 'NI-DAQmxPythonAPIdoc' |
| 64 | +htmlhelp_basename = "NI-DAQmxPythonAPIdoc" |
56 | 65 |
|
57 | 66 |
|
58 | 67 | # -- Options for LaTeX output --------------------------------------------- |
59 | 68 |
|
60 | | -latex_elements = { |
61 | | -} |
| 69 | +latex_elements = {} |
62 | 70 |
|
63 | 71 | latex_documents = [ |
64 | | - (master_doc, 'NI-DAQmxPythonAPI.tex', 'NI-DAQmx Python API Documentation', |
65 | | - 'National Instruments', 'manual'), |
| 72 | + ( |
| 73 | + master_doc, |
| 74 | + "NI-DAQmxPythonAPI.tex", |
| 75 | + "NI-DAQmx Python API Documentation", |
| 76 | + "National Instruments", |
| 77 | + "manual", |
| 78 | + ), |
66 | 79 | ] |
67 | 80 |
|
68 | 81 |
|
69 | 82 | # -- Options for manual page output --------------------------------------- |
70 | 83 |
|
71 | | -man_pages = [ |
72 | | - (master_doc, 'ni-daqmxpythonapi', 'NI-DAQmx Python API Documentation', |
73 | | - [author], 1) |
74 | | -] |
| 84 | +man_pages = [(master_doc, "ni-daqmxpythonapi", "NI-DAQmx Python API Documentation", [author], 1)] |
75 | 85 |
|
76 | 86 |
|
77 | 87 | # -- Options for Texinfo output ------------------------------------------- |
78 | 88 |
|
79 | 89 | texinfo_documents = [ |
80 | | - (master_doc, 'NI-DAQmxPythonAPI', 'NI-DAQmx Python API Documentation', |
81 | | - author, 'NI-DAQmxPythonAPI', 'One line description of project.', |
82 | | - 'Miscellaneous'), |
| 90 | + ( |
| 91 | + master_doc, |
| 92 | + "NI-DAQmxPythonAPI", |
| 93 | + "NI-DAQmx Python API Documentation", |
| 94 | + author, |
| 95 | + "NI-DAQmxPythonAPI", |
| 96 | + "One line description of project.", |
| 97 | + "Miscellaneous", |
| 98 | + ), |
83 | 99 | ] |
0 commit comments