Skip to content

Commit 137ebe2

Browse files
authored
Jfrazier/47 doc pages (#48)
* add docs to source code * add sphinx docs and gh-pages action
1 parent dd1397f commit 137ebe2

25 files changed

Lines changed: 265 additions & 6 deletions

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
style:
2222
name: "style"
2323
runs-on: ubuntu-latest
24+
# needed for gh-pages
25+
permissions:
26+
contents: write
2427
steps:
2528
- uses: actions/checkout@v4
2629
with:
@@ -70,3 +73,38 @@ jobs:
7073
if: steps.changes.outputs.python == 'true'
7174
run: |
7275
uv run pytest -v tests/
76+
77+
deploy-docs:
78+
name: "deploy docs"
79+
if: github.ref == 'refs/heads/main'
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
with:
84+
fetch-depth: 0
85+
persist-credentials: false
86+
87+
- name: "Install uv"
88+
uses: astral-sh/setup-uv@v7
89+
with:
90+
enable-cache: true
91+
92+
- name: "Install project with docs extras"
93+
run: |
94+
uv sync --group docs
95+
96+
- name: "Build Sphinx docs"
97+
run: |
98+
uv run sphinx-build -b html docs docs/_build
99+
100+
- name: "Upload Pages artifact"
101+
uses: actions/upload-pages-artifact@v3
102+
with:
103+
path: docs/_build
104+
105+
- name: "Deploy to GitHub Pages"
106+
uses: peaceiris/actions-gh-pages@v3
107+
if: github.ref == 'refs/heads/main'
108+
with:
109+
github_token: ${{ secrets.GITHUB_TOKEN }}
110+
publish_dir: docs/_build/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ uv.lock
3030

3131
# dirs
3232
tmp
33+
docs/_build/

docs/_static/.gitkeep

Whitespace-only changes.

docs/api.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
API Layer
2+
=========
3+
4+
api.routers.transcript
5+
----------------------
6+
7+
.. automodule:: lingua_loop.api.routers.transcript
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

docs/conf.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""Sphinx configuration for lingua-loop."""
2+
3+
import sys
4+
from pathlib import Path
5+
6+
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
7+
8+
project = "lingua-loop"
9+
copyright = "2024, Jared Frazier"
10+
author = "Jared Frazier"
11+
release = "0.1.4"
12+
13+
extensions = [
14+
"sphinx.ext.autodoc",
15+
"sphinx.ext.napoleon",
16+
"sphinx.ext.viewcode",
17+
]
18+
19+
templates_path = ["_templates"]
20+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
21+
22+
html_theme = "sphinx_rtd_theme"
23+
html_static_path = ["_static"]

docs/db.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Database Layer
2+
==============
3+
4+
db.models
5+
---------
6+
7+
.. automodule:: lingua_loop.db.models
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
:exclude-members: Base
12+
13+
db.session
14+
----------
15+
16+
.. automodule:: lingua_loop.db.session
17+
:members:
18+
:undoc-members:
19+
:show-inheritance:
20+
21+
db.transcript
22+
-------------
23+
24+
.. automodule:: lingua_loop.db.transcript
25+
:members:
26+
:undoc-members:
27+
:show-inheritance:

docs/exceptions.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Exceptions
2+
==========
3+
4+
.. automodule:: lingua_loop.exceptions
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/index.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Welcome to lingua-loop's documentation!
2+
=========================================
3+
4+
A web application to train your listening skills by transcribing real speech
5+
from YouTube videos.
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
:caption: Contents:
10+
11+
api
12+
schemas
13+
services
14+
db
15+
exceptions
16+
integrations
17+
18+
Indices and tables
19+
==================
20+
21+
* :ref:`genindex`
22+
* :ref:`modindex`
23+
* :ref:`search`

docs/integrations.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Integrations
2+
============
3+
4+
integrations.youtube.types
5+
--------------------------
6+
7+
.. automodule:: lingua_loop.integrations.youtube.types
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
integrations.youtube.wrapper
13+
----------------------------
14+
15+
.. automodule:: lingua_loop.integrations.youtube.wrapper
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:

docs/schemas.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Schemas
2+
=======
3+
4+
.. automodule:: lingua_loop.schemas.transcript
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

0 commit comments

Comments
 (0)