Skip to content
Open
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
8452527
Update photon-api-docs.yml
samfreund Apr 12, 2025
c440ce5
Update photon-api-docs.yml
samfreund Apr 12, 2025
35c72e8
Update photon-api-docs.yml
samfreund Apr 12, 2025
47b799a
add docs for python
samfreund Apr 12, 2025
462a2aa
Update photon-api-docs.yml
samfreund Apr 12, 2025
7c6bab1
Update photon-api-docs.yml
samfreund Apr 12, 2025
6d816b5
Update photon-api-docs.yml
samfreund Apr 12, 2025
3c73b68
Update index.md
samfreund Apr 12, 2025
55303cc
Update index.md
samfreund Apr 12, 2025
34057f2
autogen files
samfreund Apr 13, 2025
32e4f00
Merge branch 'py-docs' of github.com:photonvision/photonvision into p…
samfreund Apr 13, 2025
ddacff7
Update photon-api-docs.yml
samfreund Apr 13, 2025
05309b1
Update mkdocs.yml
samfreund Apr 13, 2025
abc67bd
add logo
samfreund Apr 13, 2025
88a1e78
actually add the logo
samfreund Apr 13, 2025
77d5388
Update photon-api-docs.yml
samfreund Apr 13, 2025
e334d26
Update python.yml
samfreund Apr 13, 2025
358f574
man I hate linting
samfreund Apr 13, 2025
871ca61
Merge branch 'main' into py-docs
samfreund Apr 13, 2025
eb85834
add brand color
samfreund Apr 13, 2025
331f4f0
Merge branch 'py-docs' of github.com:photonvision/photonvision into p…
samfreund Apr 13, 2025
d1761d0
update to exclude packet.py
samfreund Apr 13, 2025
228caf4
Update photon-api-docs.yml
samfreund Apr 13, 2025
3cdda8a
Add instructions for excluding a file
samfreund Apr 13, 2025
e522642
linting
samfreund Apr 13, 2025
4081502
Update photon-api-docs.yml
samfreund Apr 13, 2025
3547d05
exclude generated files
samfreund Apr 13, 2025
aacbdf5
Update index.md
samfreund Apr 13, 2025
a5b1cc0
Update photon-api-docs.yml
samfreund Apr 13, 2025
a5bc638
Merge branch 'main' into py-docs
samfreund Apr 13, 2025
ffdda9d
Update photon-api-docs.yml
samfreund Apr 13, 2025
44b46cf
yeah that's good enough
samfreund Apr 14, 2025
0bec1f2
Update photon-api-docs.yml
samfreund Apr 14, 2025
0147a44
remove source
samfreund Apr 14, 2025
3eea79f
Merge branch 'py-docs' of github.com:photonvision/photonvision into p…
samfreund Apr 14, 2025
b22371d
Merge branch 'main' into py-docs
samfreund Apr 15, 2025
abcd6b8
add docs to readme
samfreund May 8, 2025
87b219d
Merge branch 'main' into py-docs
samfreund May 8, 2025
697e52f
lint
samfreund May 8, 2025
96b0938
Merge branch 'py-docs' of github.com:photonvision/photonvision into p…
samfreund May 8, 2025
c2581f3
limit publishing
samfreund May 8, 2025
fa8b60f
convert to requirements.txt
samfreund May 9, 2025
ebd1071
Merge branch 'main' into py-docs
samfreund May 9, 2025
416e2f7
update versions
samfreund May 9, 2025
783ed82
Merge branch 'py-docs' of github.com:photonvision/photonvision into p…
samfreund May 9, 2025
476cd6d
Update photon-api-docs.yml
samfreund May 9, 2025
8fb29ff
Update photon-api-docs.yml
samfreund May 9, 2025
dc0985d
fix docstrings style
samfreund May 9, 2025
cf68403
Merge branch 'py-docs' of github.com:photonvision/photonvision into p…
samfreund May 9, 2025
50adef1
publish release docs
samfreund May 9, 2025
abb8ccf
add conditionals for publishing
samfreund May 9, 2025
26f08a6
switch to sphinx
samfreund May 9, 2025
8cf48be
update requirements.txt
samfreund May 9, 2025
326c77f
dammit, it was a typo
samfreund May 9, 2025
892e240
change theme
samfreund May 9, 2025
6f2fd19
add files to index
samfreund May 9, 2025
1637be6
change path
samfreund May 9, 2025
05fcf87
debugggggging
samfreund May 9, 2025
6fbb41f
this should fix importing?
samfreund May 9, 2025
46e7170
trigger docs run
samfreund Jun 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/photon-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
run: npm run build-demo
- uses: actions/upload-artifact@v4
with:
name: built-demo
name: demo
path: photon-client/dist/

run_api_docs:
name: Build API Docs
run_java_cpp_docs:
name: Build Java and C++ API Docs
runs-on: "ubuntu-22.04"
steps:
- name: Checkout code
Expand All @@ -63,18 +63,46 @@ jobs:
./gradlew photon-docs:generateJavaDocs photon-docs:doxygen
- uses: actions/upload-artifact@v4
with:
name: built-docs
name: docs-java-cpp
path: photon-docs/build/docs

run_py_docs:
name: Build Python API Docs
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-gen-files mkdocs-literate-nav mkdocs-section-index mkdocs-exclude

- name: Build MkDocs site
run: mkdocs build
working-directory: photon-lib/py

- name: Upload built site as artifact
uses: actions/upload-artifact@v4
with:
name: docs-python
path: photon-lib/py/site/

publish_api_docs:
name: Publish API Docs
needs: [run_api_docs]
needs: [ run_java_cpp_docs, run_py_docs ]
runs-on: ubuntu-22.04
steps:
# Download docs artifact
- uses: actions/download-artifact@v4
with:
name: built-docs
pattern: docs-*
- run: find .
- name: Publish Docs To Development
if: github.ref == 'refs/heads/main'
Expand All @@ -100,7 +128,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: built-demo
name: demo
- run: find .
- name: Publish demo
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel pytest mypy
pip install setuptools wheel pytest mypy mkdocs mkdocs-gen-files

- name: Build wheel
working-directory: ./photon-lib/py
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,13 @@ venv
.venv/*
.venv
networktables.json

# Web stuff
photon-server/src/main/resources/web/*
node_modules
dist
components.d.ts

# Py docs stuff
photon-lib/py/site
photon-lib/py/docs/reference
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are interested in contributing code or documentation to the project, plea
- Photon UI demo: [http://photonvision.global/](http://photonvision.global/) (or [manual link](https://photonvision.github.io/photonvision/built-client/))
- Javadocs: [javadocs.photonvision.org](https://javadocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/javadoc/))
- C++ Doxygen [cppdocs.photonvision.org](https://cppdocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/doxygen/html/))

- Python Documentation [pydocs.photonvision.org](https://pydocs.photonvision.org)
## Building

Gradle is used for all C++ and Java code, and NPM is used for the web UI. Instructions to compile PhotonVision yourself can be found [in our docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#compiling-instructions).
Expand Down
4 changes: 3 additions & 1 deletion docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,7 @@ docs/contributing/index

Java <https://javadocs.photonvision.org>

C++ <https://cppdocs.photonvision.org/>
C++ <https://cppdocs.photonvision.org>

Python <https://pydocs.photonvision.org>
```
24 changes: 24 additions & 0 deletions photon-lib/py/docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
* [estimatedRobotPose](reference/estimatedRobotPose.md)
* estimation
* [cameraTargetRelation](reference/estimation/cameraTargetRelation.md)
* [openCVHelp](reference/estimation/openCVHelp.md)
* [rotTrlTransform3d](reference/estimation/rotTrlTransform3d.md)
* [targetModel](reference/estimation/targetModel.md)
* [visionEstimation](reference/estimation/visionEstimation.md)
* networktables
* [NTTopicSet](reference/networktables/NTTopicSet.md)
* [photonCamera](reference/photonCamera.md)
* [photonPoseEstimator](reference/photonPoseEstimator.md)
* simulation
* [photonCameraSim](reference/simulation/photonCameraSim.md)
* [simCameraProperties](reference/simulation/simCameraProperties.md)
* [videoSimUtil](reference/simulation/videoSimUtil.md)
* [visionSystemSim](reference/simulation/visionSystemSim.md)
* [visionTargetSim](reference/simulation/visionTargetSim.md)
* targeting
* [TargetCorner](reference/targeting/TargetCorner.md)
* [multiTargetPNPResult](reference/targeting/multiTargetPNPResult.md)
* [photonPipelineResult](reference/targeting/photonPipelineResult.md)
* [photonTrackedTarget](reference/targeting/photonTrackedTarget.md)
* timesync
* [timeSyncServer](reference/timesync/timeSyncServer.md)
3 changes: 3 additions & 0 deletions photon-lib/py/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PhotonLib Python Docs

For the full PhotonVision documentation visit [docs.photonvision.org](https://docs.photonvision.org).
23 changes: 23 additions & 0 deletions photon-lib/py/docs/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions photon-lib/py/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:root > * {
--md-primary-fg-color: #3498DB;
}
29 changes: 29 additions & 0 deletions photon-lib/py/gen_api_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# gen_api_docs.py

from pathlib import Path

import mkdocs_gen_files

nav = mkdocs_gen_files.Nav()

for path in sorted(Path("photonlibpy").rglob("*.py")):
if path.name == "py.typed":
continue

module_path = path.with_suffix("").as_posix().replace("/", ".")
parts = tuple(path.relative_to("photonlibpy").with_suffix("").parts)

if path.name == "__init__.py":
continue
else:
doc_path = Path("reference", *parts).with_suffix(".md")

nav[parts] = doc_path.as_posix()

with mkdocs_gen_files.open(doc_path, "w") as f:
f.write(f"# `{module_path}`\n\n::: {module_path}")

mkdocs_gen_files.set_edit_path(doc_path, path)

with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())
39 changes: 39 additions & 0 deletions photon-lib/py/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
site_name: PhotonLibPy Docs
theme:
name: material
favicon: docs/favicon.ico # If you want a favicon
logo: logo.svg # Optional logo
palette:
primary: custom

plugins:
- search:
- mkdocstrings:
handlers:
python:
options:
show_source: false
paths:
- "."
- gen-files:
scripts:
- gen_api_docs.py
- literate-nav
- section-index
# To exclude files, add them under glob using their
# path from photonlibpy prepended by reference/
# Additionally, change the extension from .py to .md
- exclude:
glob:
- "reference/packet.md"
- "reference/generated/*"

nav:
- Home: index.md
- Reference: reference/SUMMARY.md

extra_css:
- stylesheets/extra.css

extra_javascript:
- js/exclude-details.js
Loading