Skip to content

Commit

Permalink
Fix documentation site
Browse files Browse the repository at this point in the history
- Fixes #32
  • Loading branch information
virtuald committed Jan 20, 2024
1 parent f930bf6 commit 3741351
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 48 deletions.
1 change: 0 additions & 1 deletion commands2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"WaitCommand",
"WaitUntilCommand",
"WrapperCommand",
"Trigger", # was here in 2023
]

if not TYPE_CHECKING:
Expand Down
19 changes: 19 additions & 0 deletions commands2/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,22 @@ def deadline(deadline: Command, *commands: Command) -> Command:
:returns: the command group
"""
return ParallelDeadlineGroup(deadline, *commands)


__all__ = [
"none",
"runOnce",
"run",
"startEnd",
"runEnd",
"print_",
"waitSeconds",
"waitUntil",
"either",
"select",
"sequence",
"repeatingSequence",
"parallel",
"race",
"deadline",
]
4 changes: 3 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
/commands2.rst
/commands2
/commands2.button.rst
/commands2.button
/commands2.button
/commands2.cmd.rst
/commands2.cmd/
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ using this pattern, we recommend that you consult the Java version of the
commands2
commands2.button
commands2.cmd
commands2.sysid
31 changes: 9 additions & 22 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import os
from os.path import abspath, dirname

from importlib.metadata import version as get_version

# Project must be built+installed to generate docs
import commands2

Expand Down Expand Up @@ -51,25 +53,15 @@
# 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(commands2.__version__.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = commands2.__version__

release: str = get_version("robotpy-commands-v2")
version: str = ".".join(release.split(".")[:2])

autoclass_content = "both"

intersphinx_mapping = {
"networktables": (
f"https://robotpy.readthedocs.io/projects/pynetworktables/en/{rtd_version}/",
None,
),
"wpilib": (
f"https://robotpy.readthedocs.io/projects/wpilib/en/{rtd_version}/",
None,
),
"wpimath": (
f"https://robotpy.readthedocs.io/projects/wpimath/en/{rtd_version}/",
"robotpy": (
f"https://robotpy.readthedocs.io/projects/robotpy/en/{rtd_version}/",
None,
),
}
Expand All @@ -83,13 +75,7 @@

# -- 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"
html_theme = "sphinx_rtd_theme"

# Output file base name for HTML help builder.
htmlhelp_basename = "RobotPyCommandDoc"
Expand Down Expand Up @@ -156,3 +142,4 @@
gen_package(root, "commands2")
gen_package(root, "commands2.button")
gen_package(root, "commands2.cmd")
gen_package(root, "commands2.sysid")
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
sphinx
sphinx-rtd-theme
robotpy-sphinx-plugin
-e docs
-e .
23 changes: 0 additions & 23 deletions docs/setup.py

This file was deleted.

0 comments on commit 3741351

Please sign in to comment.