Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
144 changes: 22 additions & 122 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,150 +1,50 @@
# Makefile for Sphinx documentation
#
# Uses `uv run` which automatically manages the virtual environment.
# No manual venv setup required. Works on Windows, macOS, and Linux.

# Default target shows help
.DEFAULT_GOAL := help

.PHONY: help docs-html docs-clean docs-live docs-publish ensure-docs-env check-uv
.PHONY: help docs-html docs-clean docs-live docs-publish check-uv

# Detect OS for cross-platform compatibility
ifeq ($(OS),Windows_NT)
RM_CMD = if exist _build rmdir /s /q _build
CHECK_UV = @where uv >nul 2>&1 || (echo. && echo uv is not installed. Install from: https://docs.astral.sh/uv/getting-started/installation/ && exit /b 1)
else
RM_CMD = rm -rf _build
CHECK_UV = @command -v uv >/dev/null 2>&1 || { echo ""; echo "❌ uv is not installed. Install from: https://docs.astral.sh/uv/getting-started/installation/"; echo ""; exit 1; }
endif

# Help target
help: ## Show this help message
@echo ""
@echo "📚 Documentation Build System"
@echo "=============================="
@echo "Documentation Build System"
@echo "=========================="
@echo ""
@echo "Available targets:"
@echo " make docs-html Build HTML documentation"
@echo " make docs-live Start live-reload server"
@echo " make docs-publish Build for publication (fail on warnings)"
@echo " make docs-clean Clean built documentation"
@echo ""
@echo "Note: Environment is automatically set up on first run."
@echo ""

# Detect OS for cross-platform compatibility
ifeq ($(OS),Windows_NT)
VENV_PYTHON = ../.venv-docs/Scripts/python.exe
VENV_ACTIVATE = ..\\.venv-docs\\Scripts\\activate
VENV_ACTIVATE_PS = ..\\.venv-docs\\Scripts\\Activate.ps1
RM_CMD = if exist _build rmdir /s /q _build
ECHO_BLANK = @echo.
else
VENV_PYTHON = ../.venv-docs/bin/python
VENV_ACTIVATE = source ../.venv-docs/bin/activate
RM_CMD = rm -rf _build
ECHO_BLANK = @echo ""
endif

# Check if uv is installed
check-uv:
ifeq ($(OS),Windows_NT)
@where uv >nul 2>&1 || ( \
echo. && \
echo ❌ uv is not installed or not in PATH && \
echo. && \
echo Please install uv: https://docs.astral.sh/uv/getting-started/installation/ && \
exit 1 \
)
else
@command -v uv >/dev/null 2>&1 || ( \
echo ""; \
echo "❌ uv is not installed or not in PATH"; \
echo ""; \
echo "Please install uv: https://docs.astral.sh/uv/getting-started/installation/"; \
echo ""; \
exit 1; \
)
endif

# Ensure docs environment exists and is up to date
ensure-docs-env: check-uv
@if [ ! -f "$(VENV_PYTHON)" ]; then \
echo "📦 Setting up docs environment with uv..."; \
cd .. && uv venv .venv-docs && uv pip install --group docs --python .venv-docs; \
echo "✅ Environment ready!"; \
fi
$(CHECK_UV)

docs-html: ensure-docs-env
docs-html: check-uv
@echo "Building HTML documentation..."
$(VENV_PYTHON) -m sphinx -b html . _build/html
cd .. && uv run --group docs sphinx-build -b html docs docs/_build/html

docs-publish: ensure-docs-env
docs-publish: check-uv
@echo "Building HTML documentation for publication (fail on warnings)..."
$(VENV_PYTHON) -m sphinx --fail-on-warning --builder html . _build/html
cd .. && uv run --group docs sphinx-build --fail-on-warning -b html docs docs/_build/html

docs-clean:
@echo "Cleaning built documentation..."
$(RM_CMD)

docs-live: ensure-docs-env
docs-live: check-uv
@echo "Starting live-reload server (sphinx-autobuild)..."
$(VENV_PYTHON) -m sphinx_autobuild --port 8001 . _build/html
@echo "Setting up docs virtual environment with uv..."
ifeq ($(OS),Windows_NT)
@where uv >nul 2>&1 || ( \
echo. && \
echo ❌ uv is not installed or not in PATH && \
echo. && \
echo uv is a fast Python package installer and resolver. && \
echo Please install it using one of the following methods: && \
echo. && \
echo 🪟 Windows PowerShell: && \
echo powershell -c "irm https://astral.sh/uv/install.ps1 | iex" && \
echo. && \
echo 📦 pip: && \
echo pip install uv && \
echo. && \
echo 🍺 Scoop: && \
echo scoop install uv && \
echo. && \
echo After installation, you may need to: && \
echo 1. Restart your terminal && \
echo 2. Or add uv to your PATH manually && \
echo 3. Then run 'make docs-env' again && \
echo. && \
echo For more installation options, visit: https://docs.astral.sh/uv/getting-started/installation/ && \
exit 1 \
)
else
@command -v uv >/dev/null 2>&1 || ( \
echo ""; \
echo "❌ uv is not installed or not in PATH"; \
echo ""; \
echo "uv is a fast Python package installer and resolver."; \
echo "Please install it using one of the following methods:"; \
echo ""; \
echo "🐧 Linux/Unix:"; \
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"; \
echo ""; \
echo "🍺 Homebrew (macOS):"; \
echo " brew install uv"; \
echo ""; \
echo "📦 pip:"; \
echo " pip install uv"; \
echo ""; \
echo "After installation, you may need to:"; \
echo "1. Restart your terminal or run: source ~/.bashrc (or ~/.zshrc)"; \
echo "2. Or add uv to your PATH manually"; \
echo "3. Then run 'make docs-env' again"; \
echo ""; \
echo "For more installation options, visit: https://docs.astral.sh/uv/getting-started/installation/"; \
exit 1; \
)
endif
@echo "✅ uv found, creating virtual environment..."
cd .. && uv venv .venv-docs
cd .. && uv pip install --group docs --python .venv-docs
$(ECHO_BLANK)
@echo "✅ Documentation environment setup complete!"
$(ECHO_BLANK)
@echo "📝 Note: The environment is NOT automatically activated."
@echo "To manually activate the docs environment, run:"
ifeq ($(OS),Windows_NT)
@echo " For Command Prompt: $(VENV_ACTIVATE)"
@echo " For PowerShell: $(VENV_ACTIVATE_PS)"
else
@echo " $(VENV_ACTIVATE)"
endif
$(ECHO_BLANK)
@echo "Once activated, you can run other docs commands like:"
@echo " make docs-html # Build HTML documentation"
@echo " make docs-live # Start live-reload server"
cd .. && uv run --group docs sphinx-autobuild --port 8001 docs docs/_build/html
36 changes: 18 additions & 18 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,31 +113,31 @@
# https://documatt.com/sphinx-reredirects/
#
# Use this to create redirects when pages are moved or renamed.
# Format: "old/path.html": "new/path.html"
# Format: "old/path.html": "target-relative-to-source.html"
#
# Examples:
# - Simple redirect: "old-page.html": "new-page.html"
# - Directory redirect: "old-dir/page.html": "new-dir/page.html"
# IMPORTANT: Target paths are RELATIVE to the source file's directory!
# - Same directory: "dir/old.html": "new.html"
# - Cross directory: "old-dir/page.html": "../new-dir/page.html"
# - External redirect: "old-page.html": "https://example.com/new-page"
#
# Note: Paths are relative to the HTML output directory.
# The .html extension is required for source paths.

redirects = {
# Get Started section renames
"get-started/setup-installation.html": "get-started/detailed-setup.html",
# Get Started section renames (same directory)
"get-started/setup-installation.html": "detailed-setup.html",
# RL Framework Integration moved from training/ to contribute/
"training/rl-framework-integration/index.html": "contribute/rl-framework-integration/index.html",
"training/rl-framework-integration/gym-integration-footprint-and-form-factor.html": "contribute/rl-framework-integration/gym-integration-footprint-and-form-factor.html",
"training/rl-framework-integration/gym-rl-framework-integration-success-criteria.html": "contribute/rl-framework-integration/gym-rl-framework-integration-success-criteria.html",
"training/rl-framework-integration/generation-backend-and-openai-compatible-http-server.html": "contribute/rl-framework-integration/generation-backend-and-openai-compatible-http-server.html",
"training/rl-framework-integration/openai-compatible-http-server-on-policy-correction.html": "contribute/rl-framework-integration/openai-compatible-http-server-on-policy-correction.html",
# Source is in training/rl-framework-integration/, target is in contribute/rl-framework-integration/
"training/rl-framework-integration/index.html": "../../contribute/rl-framework-integration/index.html",
"training/rl-framework-integration/gym-integration-footprint-and-form-factor.html": "../../contribute/rl-framework-integration/gym-integration-footprint-and-form-factor.html",
"training/rl-framework-integration/gym-rl-framework-integration-success-criteria.html": "../../contribute/rl-framework-integration/gym-rl-framework-integration-success-criteria.html",
"training/rl-framework-integration/generation-backend-and-openai-compatible-http-server.html": "../../contribute/rl-framework-integration/generation-backend-and-openai-compatible-http-server.html",
"training/rl-framework-integration/openai-compatible-http-server-on-policy-correction.html": "../../contribute/rl-framework-integration/openai-compatible-http-server-on-policy-correction.html",
# Alternate naming conventions for the same pages
"training/rl-framework-integration/integration-footprint.html": "contribute/rl-framework-integration/gym-integration-footprint-and-form-factor.html",
"training/rl-framework-integration/on-policy-corrections.html": "contribute/rl-framework-integration/openai-compatible-http-server-on-policy-correction.html",
# About/Concepts section renames
"about/concepts/core-abstractions.html": "about/concepts/core-components.html",
"about/concepts/configuration-system.html": "about/concepts/configuration.html",
# Top-level page moves
"training/rl-framework-integration/integration-footprint.html": "../../contribute/rl-framework-integration/gym-integration-footprint-and-form-factor.html",
"training/rl-framework-integration/on-policy-corrections.html": "../../contribute/rl-framework-integration/openai-compatible-http-server-on-policy-correction.html",
# About/Concepts section renames (same directory)
"about/concepts/core-abstractions.html": "core-components.html",
"about/concepts/configuration-system.html": "configuration.html",
# Top-level page moves (from root to reference/)
"how-to-faq.html": "reference/faq.html",
}
5 changes: 4 additions & 1 deletion docs/project.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"name": "nemo-gym", "version": "0.1.0"}
{
"name": "nemo-gym",
"version": "0.1.1"
}
16 changes: 15 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.