Skip to content

Commit

Permalink
feat: sphinx + readthedocs integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Jul 11, 2023
1 parent 9554116 commit e40f718
Show file tree
Hide file tree
Showing 15 changed files with 479 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: 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
42 changes: 42 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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


import pathlib
import sys

# -- Path setup --------------------------------------------------------------
sys.path.insert(0, str(pathlib.Path(__file__).parent.parent.parent / "src"))

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

project = "horde_sdk"
copyright = "2023, hairda-org" # noqa: A001
author = "tazlin, db0"
release = "0.1.x"

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

extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]

templates_path = ["_templates"]
exclude_patterns: list[str] = []

autodoc_default_options = {
"members": True,
"member-order": "bysource",
"undoc-members": "__init__",
"exclude-members": "__weakref__,model_fields,model_config",
}

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

html_theme = "sphinx_rtd_theme"
# html_theme = "groundwork"

html_static_path = ["_static"]
10 changes: 10 additions & 0 deletions docs/source/horde_sdk.ai_horde_api.apimodels.generate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
horde\_sdk.ai\_horde\_api.apimodels.generate package
====================================================

Module contents
---------------

.. automodule:: horde_sdk.ai_horde_api.apimodels.generate
:members:
:undoc-members:
:show-inheritance:
29 changes: 29 additions & 0 deletions docs/source/horde_sdk.ai_horde_api.apimodels.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
horde\_sdk.ai\_horde\_api.apimodels package
===========================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

horde_sdk.ai_horde_api.apimodels.generate

Submodules
----------

horde\_sdk.ai\_horde\_api.apimodels.base module
-----------------------------------------------

.. automodule:: horde_sdk.ai_horde_api.apimodels.base
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: horde_sdk.ai_horde_api.apimodels
:members:
:undoc-members:
:show-inheritance:
61 changes: 61 additions & 0 deletions docs/source/horde_sdk.ai_horde_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
horde\_sdk.ai\_horde\_api package
=================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

horde_sdk.ai_horde_api.apimodels

Submodules
----------

horde\_sdk.ai\_horde\_api.ai\_horde\_client module
--------------------------------------------------

.. automodule:: horde_sdk.ai_horde_api.ai_horde_client
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ai\_horde\_api.consts module
---------------------------------------

.. automodule:: horde_sdk.ai_horde_api.consts
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ai\_horde\_api.endpoints module
------------------------------------------

.. automodule:: horde_sdk.ai_horde_api.endpoints
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ai\_horde\_api.fields module
---------------------------------------

.. automodule:: horde_sdk.ai_horde_api.fields
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ai\_horde\_api.metadata module
-----------------------------------------

.. automodule:: horde_sdk.ai_horde_api.metadata
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: horde_sdk.ai_horde_api
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/source/horde_sdk.ai_horde_worker.locale_info.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
horde\_sdk.ai\_horde\_worker.locale\_info package
=================================================

Submodules
----------

horde\_sdk.ai\_horde\_worker.locale\_info.bridge\_data\_fields module
---------------------------------------------------------------------

.. automodule:: horde_sdk.ai_horde_worker.locale_info.bridge_data_fields
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: horde_sdk.ai_horde_worker.locale_info
:members:
:undoc-members:
:show-inheritance:
37 changes: 37 additions & 0 deletions docs/source/horde_sdk.ai_horde_worker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
horde\_sdk.ai\_horde\_worker package
====================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

horde_sdk.ai_horde_worker.locale_info

Submodules
----------

horde\_sdk.ai\_horde\_worker.bridge\_data module
------------------------------------------------

.. automodule:: horde_sdk.ai_horde_worker.bridge_data
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ai\_horde\_worker.kudos module
-----------------------------------------

.. automodule:: horde_sdk.ai_horde_worker.kudos
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: horde_sdk.ai_horde_worker
:members:
:undoc-members:
:show-inheritance:
45 changes: 45 additions & 0 deletions docs/source/horde_sdk.generic_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
horde\_sdk.generic\_api package
===============================

Submodules
----------

horde\_sdk.generic\_api.apimodels module
----------------------------------------

.. automodule:: horde_sdk.generic_api.apimodels
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.generic\_api.endpoints module
----------------------------------------

.. automodule:: horde_sdk.generic_api.endpoints
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.generic\_api.generic\_client module
----------------------------------------------

.. automodule:: horde_sdk.generic_api.generic_client
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.generic\_api.metadata module
---------------------------------------

.. automodule:: horde_sdk.generic_api.metadata
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: horde_sdk.generic_api
:members:
:undoc-members:
:show-inheritance:
45 changes: 45 additions & 0 deletions docs/source/horde_sdk.ratings_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
horde\_sdk.ratings\_api package
===============================

Submodules
----------

horde\_sdk.ratings\_api.apimodels module
----------------------------------------

.. automodule:: horde_sdk.ratings_api.apimodels
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ratings\_api.endpoints module
----------------------------------------

.. automodule:: horde_sdk.ratings_api.endpoints
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ratings\_api.metadata module
---------------------------------------

.. automodule:: horde_sdk.ratings_api.metadata
:members:
:undoc-members:
:show-inheritance:

horde\_sdk.ratings\_api.ratings\_client module
----------------------------------------------

.. automodule:: horde_sdk.ratings_api.ratings_client
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: horde_sdk.ratings_api
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit e40f718

Please sign in to comment.