Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy Documentation
on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[doc]
- name: Build the documentation
run: mkdocs build
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./site"
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
12 changes: 12 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ two services. Please follow this packaging [guide] to setup your accounts
accordingly. We also recommend to setup a github [environment] to restrict
which contributors can deploy packages.

## Automatic Documentation Deployment

You can automatically publish project documentation to GitHub Pages on every
new tag. To enable this:

- Go to your repository on GitHub.
- Navigate to **Settings** > **Pages**.
- Under **Build and deployment**, set **Source** to **GitHub Actions**.

This setup ensures your documentation is updated and available online whenever
you create a new release tag via Github workflows.

[environment]: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment/
[guide]: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
[pypi]: https://pypi.org/
Expand Down
20 changes: 18 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Development

To improve code quality, we use [nox] to run linters, type checkers, unit
tests, documentation and more. We recommend installing nox using [pipx] to have
it available globally.
tests, and more. We recommend installing nox using [pipx] to have it available
globally.

```bash
# install
Expand Down Expand Up @@ -35,6 +35,22 @@ python -m pipx install pre-commit
pre-commit install
```

## Documentation

Make sure the documentation dependencies for the project are properly installed
with

```bash
pip install .[doc]
```

To run the documentation locally use the following command and click the
provided link to open it in the browser.

```bash
mkdocs serve
```

[editable]: https://setuptools.pypa.io/en/latest/userguide/development_mode.html
[nox]: https://nox.thea.codes/en/stable/index.html
[pipx]: https://pypa.github.io/pipx/
Expand Down
12 changes: 12 additions & 0 deletions docs/reference/encodings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@ icon: material/file-code
---

# Encodings


<!-- ::: src/fillname/encodings/test.lp
handler: asp
options:
glossary: true
predicate_table: true
dependency_graph: true
encodings:
git_link: true
source: true
start_level: 1 -->
15 changes: 1 addition & 14 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys

import nox

Expand All @@ -22,19 +21,7 @@ def doc(session):
- further arguments are passed to mkbuild
"""

options = session.posargs[:]
open_doc = "serve" in options
if open_doc:
options.remove("serve")

session.install("-e", ".[doc]")

if open_doc:
open_cmd = "xdg-open" if sys.platform == "linux" else "open"
session.run(open_cmd, "http://localhost:8000/systems/fillname/")
session.run("mkdocs", "serve", *options)
else:
session.run("mkdocs", "build", *options)
session.error("Not longer supported, use `mkdocs serve` instead")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say, either remove it or keep it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given our discussion on how if it builds something this jobs makes no sense, I would remove it. I was just trying to make it so that if people where usedto it, they know what do now, but I guess the docs should be enough

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think it makes no sense, just remove it. Then we can merge this.



@nox.session
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ format = ["black", "isort", "autoflake"]
lint_pylint = ["pylint"]
typecheck = ["types-setuptools", "mypy"]
test = ["coverage[toml]"]
doc = ["mkdocs", "mkdocs-material", "mkdocstrings[python]"]
doc = ["mkdocs", "mkdocs-material", "mkdocstrings[python]", "mkdoclingo"]
dev = ["fillname[test,typecheck,lint_pylint]"]

[project.scripts]
Expand Down