-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathconf.py
213 lines (176 loc) · 7.34 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# RobotPy WPILib documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 2 21:31:04 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
#
# Imports
#
import sys
import os
from datetime import date
import subprocess
from os.path import abspath, join, dirname
sys.path.insert(0, abspath(join(dirname(__file__))))
# -- 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",
"sphinx_inline_tabs",
"sphinxext.opengraph",
"sphinx_reredirects",
]
ogp_custom_meta_tags = [
'<meta property="og:ignore_canonical" content="true" />',
'<meta name="theme-color" content="#3393d5" />',
]
# 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"
copyright = f"2014-{date.today().year}, RobotPy development team"
frc_docs = "https://docs.wpilib.org/en/stable"
intersphinx_mapping = {
"commandsv2": (
"https://robotpy.readthedocs.io/projects/commands-v2/en/%s/" % rtd_version,
None,
),
"pyfrc": (
"https://robotpy.readthedocs.io/projects/pyfrc/en/%s/" % rtd_version,
None,
),
"robotpy": (
"https://robotpy.readthedocs.io/projects/robotpy/en/%s/" % rtd_version,
None,
),
"robotpy_ext": (
"https://robotpy.readthedocs.io/projects/utilities/en/%s/" % rtd_version,
None,
),
"frc": (frc_docs, None),
}
redirects = {
"getting_started": f"{frc_docs}/docs/zero-to-robot/introduction.html",
"2020_notes": "upgrade_notes.html",
"install/pynetworktables": "pyntcore.html",
"frameworks/command": f"{frc_docs}/docs/software/commandbased/",
"guide/anatomy": f"{frc_docs}/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.html",
"guide/index": f"{frc_docs}/docs/software/python/",
"guide/deploy": f"{frc_docs}/docs/software/python/subcommands/deploy.html",
"guide/examples": "https://github.com/robotpy/examples",
"guide/guidelines": "guidelines",
"guide/nt": f"{frc_docs}/docs/software/networktables/index.html",
"guide/running": f"{frc_docs}/docs/software/python/subcommands/index.html",
"guide/python": "https://docs.python-guide.org/en/latest/intro/learning/",
"guide/simulator": f"{frc_docs}/docs/software/wpilib-tools/robot-simulation/introduction.html",
"guide/testing": "testing",
"hw": f"{frc_docs}/docs/hardware/hardware-basics/index.html",
"install/computer": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/components": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/packages": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/robot": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/commands": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/cscore": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/ctre": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/navx": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/pathplannerlib": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/pwfusion": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/pyfrc": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/pyntcore": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/rev": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"vision/code": f"{frc_docs}/docs/software/vision-processing/index.html",
"vision/index": f"{frc_docs}/docs/software/vision-processing/index.html",
"vision/other": f"{frc_docs}/docs/software/vision-processing/index.html",
"vision/roborio": f"{frc_docs}/docs/software/vision-processing/roborio/index.html",
}
# 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 = subprocess.check_output(("git", "describe", "--tags"), text=True).split(".")[
0
]
# The full version, including alpha/beta/rc tags.
release = 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 ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
# Output file base name for HTML help builder.
htmlhelp_basename = "RobotPy"
# -- 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",
"RobotPy.tex",
"RobotPy 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",
"RobotPy",
"RobotPy Documentation",
"RobotPy development team",
"RobotPy",
"One line description of project.",
"Miscellaneous",
)
]
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_title = "RobotPy"
epub_author = "RobotPy development team"
epub_publisher = "RobotPy development team"
epub_copyright = "2014-2024, 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.sidebar import generate_sidebar
generate_sidebar(
globals(),
"robotpy",
"https://raw.githubusercontent.com/robotpy/docs-sidebar/master/sidebar.toml",
)