Skip to content

Commit

Permalink
Added documentation starter project (#2)
Browse files Browse the repository at this point in the history
* Initial changes

* Updated Docs

* Misc. changes

* Adjustments

* Move to GH pages
  • Loading branch information
thetestgame authored Nov 13, 2024
1 parent 852122d commit c31cf91
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/sphinx-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy Sphinx documentation to Pages
on:
push:
branches: [main] # branch to trigger deployment

jobs:
pages:
runs-on: ubuntu-20.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
pages: write
id-token: write

steps:
- id: deployment
uses: sphinx-notes/pages@v3
with:
documentation_path: docs/source
requirements_path: docs/requirements.txt
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
sphinx-autobuild
sphinx_rtd_theme
38 changes: 38 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Panda3D Astron'
copyright = '2024, Jordan Maxwell'
author = 'Jordan Maxwell'
release = '1.0.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.autodoc', # For pulling in docstrings
'sphinx.ext.napoleon', # For Google or NumPy style docstrings (optional)
'sphinx_rtd_theme' # For the Read the Docs theme
]

templates_path = ['_templates']
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = ['_static']

# -- Path setup --------------------------------------------------------------
# If extensions are in another directory, add that directory to sys.path.

import os
import sys

sys.path.insert(0, os.path.abspath('..'))
19 changes: 19 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. Panda3D Astron documentation master file, created by
sphinx-quickstart on Wed Nov 13 16:55:12 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Panda3D Astron documentation
============================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.


.. toctree::
:maxdepth: 2
:caption: Contents:

.. automodule:: panda3d_astron
:members:

0 comments on commit c31cf91

Please sign in to comment.