Skip to content

Commit 181495f

Browse files
committed
adds first version
0 parents  commit 181495f

24 files changed

+573
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build and Deploy Sphinx Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
18+
- name: Install dev requirements
19+
working-directory: ./docs
20+
run: pip install -r requirements.txt
21+
22+
- name: Build Sphinx Documentation
23+
run: sphinx-build docs docs/_build
24+
25+
- name: Deploy to GitHub Pages
26+
uses: peaceiris/actions-gh-pages@v3
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
publish_dir: ./docs/_build/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Doc Outputs
2+
**/docs/_build/*
3+
**/generated/*

.nojekyll

Whitespace-only changes.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# BDX-R Project Documentation

bdx_r.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
set -e # Exit on error
3+
set -u # Treat unset variables as errors
4+
5+
# Get source directory
6+
export BDX_R_DOC_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
7+
8+
# Extract the Python executable
9+
extract_python_exe() {
10+
local python_exe=""
11+
12+
# Check if using Conda
13+
if [[ -n "${CONDA_PREFIX:-}" ]]; then
14+
python_exe="${CONDA_PREFIX}/bin/python"
15+
fi
16+
17+
# Fallback to system Python if Conda Python not found
18+
if [[ -z "${python_exe}" || ! -f "${python_exe}" ]]; then
19+
if command -v python3 &> /dev/null; then
20+
python_exe="$(which python3)"
21+
elif command -v python &> /dev/null; then
22+
python_exe="$(which python)"
23+
fi
24+
fi
25+
26+
# Ensure a valid Python executable is found
27+
if [[ -z "${python_exe}" || ! -f "${python_exe}" ]]; then
28+
echo -e "[ERROR] Unable to find a valid Python executable." >&2
29+
echo -e "\tPossible reasons:\n\t1. Conda environment is not activated.\n\t2. Python is not installed.\n\t3. Only 'python3' is available but not 'python'." >&2
30+
exit 1
31+
fi
32+
33+
# Return the result
34+
echo "${python_exe}"
35+
}
36+
37+
echo "[INFO] Building documentation..."
38+
39+
# Retrieve the Python executable
40+
python_exe=$(extract_python_exe)
41+
echo "${python_exe}"
42+
43+
# # Ensure documentation directory exists
44+
if [ ! -d "${BDX_R_DOC_PATH}/docs" ]; then
45+
echo "[ERROR] Documentation directory not found: ${BDX_R_DOC_PATH}/docs" >&2
46+
exit 1
47+
fi
48+
49+
# # Install pip packages
50+
cd "${BDX_R_DOC_PATH}/docs"
51+
${python_exe} -m pip install -r requirements.txt > /dev/null
52+
53+
# # Build the documentation
54+
${python_exe} -m sphinx -b html -d _build/doctrees . _build/current
55+
56+
# # Open the documentation in the default browser
57+
echo -e "[INFO] To open documentation, run:"
58+
echo -e "\n\t\txdg-open $(pwd)/_build/current/index.html\n"
59+
60+
if [[ "$OSTYPE" == "darwin"* ]]; then
61+
open "$(pwd)/_build/current/index.html"
62+
else
63+
xdg-open "$(pwd)/_build/current/index.html"
64+
fi
65+
66+
# # Exit neatly
67+
cd - > /dev/null

docs/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
.PHONY: current-docs
12+
current-docs:
13+
@$(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/current" $(SPHINXOPTS)

docs/conf.py

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
# Copyright (c) 2022-2025, The Isaac Lab Project Developers.
2+
# All rights reserved.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
6+
# Configuration file for the Sphinx documentation builder.
7+
#
8+
# This file only contains a selection of the most common options. For a full
9+
# list see the documentation:
10+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
11+
12+
# -- Path setup --------------------------------------------------------------
13+
14+
# If extensions (or modules to document with autodoc) are in another directory,
15+
# add these directories to sys.path here. If the directory is relative to the
16+
# documentation root, use os.path.abspath to make it absolute, like shown here.
17+
#
18+
import os
19+
20+
21+
# -- Project information -----------------------------------------------------
22+
23+
project = "BDX-R Project Documentation"
24+
copyright = "2025, BDX-R Project Developers"
25+
author = "BDX-R Project Developers"
26+
27+
# -- General configuration ---------------------------------------------------
28+
29+
# Add any Sphinx extension module names here, as strings. They can be
30+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31+
# ones.
32+
extensions = [
33+
"autodocsumm",
34+
"myst_parser",
35+
"sphinx.ext.napoleon",
36+
"sphinxemoji.sphinxemoji",
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.autosummary",
39+
"sphinx.ext.githubpages",
40+
"sphinx.ext.intersphinx",
41+
"sphinx.ext.mathjax",
42+
"sphinx.ext.todo",
43+
"sphinx.ext.viewcode",
44+
"sphinxcontrib.bibtex",
45+
"sphinxcontrib.icon",
46+
"sphinx_copybutton",
47+
"sphinx_design",
48+
"sphinx_tabs.tabs", # backwards compatibility for building docs on v1.0.0
49+
"sphinx_multiversion",
50+
]
51+
52+
# mathjax hacks
53+
mathjax3_config = {
54+
"tex": {
55+
"inlineMath": [["\\(", "\\)"]],
56+
"displayMath": [["\\[", "\\]"]],
57+
},
58+
}
59+
60+
# panels hacks
61+
panels_add_bootstrap_css = False
62+
panels_add_fontawesome_css = True
63+
64+
# supported file extensions for source files
65+
source_suffix = {
66+
".rst": "restructuredtext",
67+
".md": "markdown",
68+
}
69+
70+
# make sure we don't have any unknown references
71+
# TODO: Enable this by default once we have fixed all the warnings
72+
# nitpicky = True
73+
74+
# put type hints inside the signature instead of the description (easier to maintain)
75+
autodoc_typehints = "signature"
76+
# autodoc_typehints_format = "fully-qualified"
77+
# document class *and* __init__ methods
78+
autoclass_content = "class" #
79+
# separate class docstring from __init__ docstring
80+
autodoc_class_signature = "separated"
81+
# sort members by source order
82+
autodoc_member_order = "bysource"
83+
# inherit docstrings from base classes
84+
autodoc_inherit_docstrings = True
85+
# BibTeX configuration
86+
bibtex_bibfiles = ["source/_static/refs.bib"]
87+
# generate autosummary even if no references
88+
autosummary_generate = True
89+
autosummary_generate_overwrite = False
90+
# default autodoc settings
91+
autodoc_default_options = {
92+
"autosummary": True,
93+
}
94+
95+
# generate links to the documentation of objects in external projects
96+
intersphinx_mapping = {
97+
"python": ("https://docs.python.org/3", None),
98+
}
99+
100+
# Add any paths that contain templates here, relative to this directory.
101+
templates_path = []
102+
103+
# List of patterns, relative to source directory, that match files and
104+
# directories to ignore when looking for source files.
105+
# This pattern also affects html_static_path and html_extra_path.
106+
exclude_patterns = ["_build", "_redirect", "_templates", "Thumbs.db", ".DS_Store", "README.md", "licenses/*"]
107+
108+
# Mock out modules that are not available on RTD
109+
autodoc_mock_imports = [
110+
"torch",
111+
"numpy",
112+
"matplotlib",
113+
"scipy",
114+
"carb",
115+
"warp",
116+
"pxr",
117+
"h5py",
118+
"hid",
119+
"prettytable",
120+
"tqdm",
121+
"tensordict",
122+
"trimesh",
123+
"toml",
124+
]
125+
126+
# List of zero or more Sphinx-specific warning categories to be squelched (i.e.,
127+
# suppressed, ignored).
128+
suppress_warnings = [
129+
# Generally speaking, we do want Sphinx to inform
130+
# us about cross-referencing failures. Remove this entirely after Sphinx
131+
# resolves this open issue:
132+
# https://github.com/sphinx-doc/sphinx/issues/4961
133+
# Squelch mostly ignorable warnings resembling:
134+
# WARNING: more than one target found for cross-reference 'TypeHint':
135+
# beartype.door._doorcls.TypeHint, beartype.door.TypeHint
136+
#
137+
# Sphinx currently emits *MANY* of these warnings against our
138+
# documentation. All of these warnings appear to be ignorable. Although we
139+
# could explicitly squelch *SOME* of these warnings by canonicalizing
140+
# relative to absolute references in docstrings, Sphinx emits still others
141+
# of these warnings when parsing PEP-compliant type hints via static
142+
# analysis. Since those hints are actual hints that *CANNOT* by definition
143+
# by canonicalized, our only recourse is to squelch warnings altogether.
144+
"ref.python",
145+
]
146+
147+
# -- Internationalization ----------------------------------------------------
148+
149+
# specifying the natural language populates some key tags
150+
language = "en"
151+
152+
# -- Options for HTML output -------------------------------------------------
153+
154+
import sphinx_book_theme
155+
156+
html_title = "BDX-R Project Documentation"
157+
html_theme_path = [sphinx_book_theme.get_html_theme_path()]
158+
html_theme = "sphinx_book_theme"
159+
html_favicon = "source/_static/favicon.ico"
160+
html_show_copyright = True
161+
html_show_sphinx = False
162+
html_last_updated_fmt = "" # to reveal the build date in the pages meta
163+
164+
# Add any paths that contain custom static files (such as style sheets) here,
165+
# relative to this directory. They are copied after the builtin static files,
166+
# so a file named "default.css" will overwrite the builtin "default.css".
167+
html_static_path = ["source/_static/css"]
168+
html_css_files = ["custom.css"]
169+
170+
html_theme_options = {
171+
"collapse_navigation": True,
172+
"repository_url": "https://github.com/BDX-R/BDX-R.github.io",
173+
"use_repository_button": True,
174+
"use_issues_button": True,
175+
"use_edit_page_button": True,
176+
"show_toc_level": 1,
177+
"use_sidenotes": True,
178+
"logo": {
179+
"text": "BDX-R Project Documentation",
180+
"image_light": "source/_static/bdx_r_bg.png",
181+
"image_dark": "source/_static/bdx_r_bg.png",
182+
},
183+
"icon_links": [
184+
{
185+
"name": "GitHub",
186+
"url": "https://github.com/BDX-R/BDX-R.github.io",
187+
"icon": "fa-brands fa-square-github",
188+
"type": "fontawesome",
189+
},
190+
],
191+
"icon_links_label": "Quick Links",
192+
}
193+
194+
templates_path = [
195+
"_templates",
196+
]
197+
198+
# Whitelist pattern for remotes
199+
smv_remote_whitelist = r"^.*$"
200+
# Whitelist pattern for branches (set to None to ignore all branches)
201+
smv_branch_whitelist = os.getenv("SMV_BRANCH_WHITELIST", r"^(main|devel)$")
202+
# Whitelist pattern for tags (set to None to ignore all tags)Add commentMore actions
203+
smv_tag_whitelist = os.getenv("SMV_TAG_WHITELIST", r"^v[1-9]\d*\.\d+\.\d+$")
204+
# html_sidebars = {
205+
# "**": ["navbar-logo.html", "versioning.html", "icon-links.html", "search-field.html", "sbt-sidebar-nav.html"]
206+
# }
207+
208+
html_sidebars = {
209+
"**": ["navbar-logo.html", "icon-links.html", "search-field.html", "sbt-sidebar-nav.html"]
210+
}
211+
212+
213+
# -- Advanced configuration -------------------------------------------------
214+
215+
216+
def skip_member(app, what, name, obj, skip, options):
217+
# List the names of the functions you want to skip here
218+
exclusions = ["from_dict", "to_dict", "replace", "copy", "validate", "__post_init__"]
219+
if name in exclusions:
220+
return True
221+
return None
222+
223+
224+
def setup(app):
225+
app.connect("autodoc-skip-member", skip_member)

0 commit comments

Comments
 (0)