docs: add Google-style docstrings and Sphinx autodoc setup

Add concise docstrings to all Python modules, classes, and public
functions. Configure Sphinx with napoleon extension for Google-style
docstring parsing and autodoc pages for each module.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathew Sir Guest the best
2026-05-06 23:06:37 -06:00
co-authored by Claude Opus 4.6
parent fd3ff46804
commit 4d681a92ca
16 changed files with 479 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import os
import sys
sys.path.insert(0, os.path.abspath("../.."))
project = "ai_demo_backend"
copyright = "2026, Mathew Guest"
author = "Mathew Guest"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
]
templates_path = ["_templates"]
exclude_patterns = []
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
autodoc_member_order = "bysource"
napoleon_google_docstring = True
napoleon_numpy_docstring = False
+20
View File
@@ -0,0 +1,20 @@
ai_demo_backend
===============
A backend HTTP server that powers a word search puzzle game playable in a web browser.
.. toctree::
:maxdepth: 2
:caption: Contents:
modules/app
modules/db
modules/models
modules/game
modules/handlers
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
+7
View File
@@ -0,0 +1,7 @@
App
===
.. automodule:: app
:members:
:undoc-members:
:show-inheritance:
+7
View File
@@ -0,0 +1,7 @@
Database
========
.. automodule:: db
:members:
:undoc-members:
:show-inheritance:
+10
View File
@@ -0,0 +1,10 @@
Game Logic
==========
Board Factory
-------------
.. automodule:: game.factory
:members:
:undoc-members:
:show-inheritance:
+26
View File
@@ -0,0 +1,26 @@
Handlers
========
API Handlers
------------
.. automodule:: handlers.api
:members:
:undoc-members:
:show-inheritance:
Main Handler
------------
.. automodule:: handlers.main
:members:
:undoc-members:
:show-inheritance:
Game Handler
------------
.. automodule:: handlers.game
:members:
:undoc-members:
:show-inheritance:
+18
View File
@@ -0,0 +1,18 @@
Models
======
Category
--------
.. automodule:: models.category
:members:
:undoc-members:
:show-inheritance:
Game
----
.. automodule:: models.game
:members:
:undoc-members:
:show-inheritance: