diff --git a/.github/workflows/gendocs.yml b/.github/workflows/gendocs.yml new file mode 100644 index 0000000..a26ace9 --- /dev/null +++ b/.github/workflows/gendocs.yml @@ -0,0 +1,54 @@ +name: Build and Store Documentation Artifact + +on: + push: + branches: + - master + - devel + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install sphinx poetry + poetry install + - name: Build Sphinx documentation + run: | + cd docs && ls + bash auto_docu.sh + - name: Upload documentation files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action + with: + path: docs/build/html/ + + deploy: + needs: build + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 706bc04..16c5cfa 100644 --- a/.gitignore +++ b/.gitignore @@ -175,5 +175,9 @@ pyrightconfig.json # Ollama Local Dir ollama + +# Yes i know +*.kate-swp # sphinx rst files docs/source/_modules + diff --git a/senju/haiku.py b/senju/haiku.py index e112215..66d5348 100644 --- a/senju/haiku.py +++ b/senju/haiku.py @@ -10,13 +10,6 @@ AI_BASE_URL: str = "http://ollama:11434/api" AI_GEN_ENDPOINT: str = "/generate" -def foobar(): - """WE KNOW""" - a = 3 - b = 3 - return a + b - - @dataclass class Haiku: lines: list[str] @@ -46,7 +39,7 @@ class Haiku: lines = ai_response.split("\n") - for _ in range(0, 2): + while len(lines) != 3: lines.pop() logging.warning(lines) diff --git a/senju/main.py b/senju/main.py index 1bdfd27..fd2e795 100644 --- a/senju/main.py +++ b/senju/main.py @@ -15,13 +15,6 @@ app = Flask(__name__) store = StoreManager(Path("/tmp/store.db")) -def foobar(): - """WE KNOW""" - a = 3 - b = 3 - return a + b - - @app.route("/") def index_view(): return render_template("index.html", title="Senju") diff --git a/senju/store_manager.py b/senju/store_manager.py index 72a4561..e99b98e 100644 --- a/senju/store_manager.py +++ b/senju/store_manager.py @@ -12,13 +12,6 @@ from senju.haiku import Haiku DEFAULT_DB_PATH: Path = Path("/var/lib/senju.json") -def foobar(): - """WE KNOW""" - a = 3 - b = 3 - return a + b - - class StoreManager: __slots__ = "_db", "logger" _db: TinyDB