This repository was archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconf.py
159 lines (122 loc) · 4.29 KB
/
conf.py
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Imports
#
import sys
import os
from os.path import abspath, dirname
# Project must be built+installed to generate docs
import hal
# -- RTD configuration ------------------------------------------------
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
# This is used for linking and such so we link to the thing we're building
rtd_version = os.environ.get("READTHEDOCS_VERSION", "latest")
if rtd_version not in ["stable", "latest"]:
rtd_version = "stable"
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"robotpy_sphinx.all",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = ".rst"
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "RobotPy HAL"
copyright = "2020, RobotPy development team"
intersphinx_mapping = {
"robotpy": (
"https://robotpy.readthedocs.io/en/%s/" % rtd_version,
None,
),
"pyfrc": (
"https://robotpy.readthedocs.io/projects/pyfrc/en/%s/" % rtd_version,
None,
),
"wpilib": (
"https://robotpy.readthedocs.io/projects/wpilib/en/%s/" % rtd_version,
None,
),
}
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ".".join(hal.__version__.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = hal.__version__
autoclass_content = "both"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
# -- Options for HTML output ----------------------------------------------
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
else:
html_theme = "default"
# Output file base name for HTML help builder.
htmlhelp_basename = "RobotPyHALdoc"
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
"index",
"RobotPyHAL.tex",
"RobotPy HAL Documentation",
"RobotPy development team",
"manual",
)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
"index",
"RobotPyHAL",
"RobotPy HAL Documentation",
"RobotPy development team",
"RobotPyHAL",
"One line description of project.",
"Miscellaneous",
)
]
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_title = "RobotPy HAL"
epub_author = "RobotPy development team"
epub_publisher = "RobotPy development team"
epub_copyright = "2020, RobotPy development team"
# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]
# -- Custom Document processing ----------------------------------------------
from robotpy_sphinx.regen import gen_package
from robotpy_sphinx.sidebar import generate_sidebar
generate_sidebar(
globals(),
"hal",
"https://raw.githubusercontent.com/robotpy/docs-sidebar/master/sidebar.toml",
)
root = abspath(dirname(__file__))
gen_package(root, "hal", include=["Sim*"])
gen_package(root, "hal.simulation")