diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000..1762fdc --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,33 @@ +name: Publish documentation 📚 to GitHub Pages + +on: + push: + branches: + - main + - docs/init + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v3 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: mkdocs gh-deploy --force diff --git a/.gitignore b/.gitignore index 8ec35e0..a1668e5 100644 --- a/.gitignore +++ b/.gitignore @@ -179,7 +179,7 @@ venv.bak/ .ropeproject # mkdocs documentation -/site +docs/site/ # mypy .mypy_cache/ diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100644 index 0000000..000ea34 --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,17 @@ +# Welcome to MkDocs + +For full documentation visit [mkdocs.org](https://www.mkdocs.org). + +## Commands + +* `mkdocs new [dir-name]` - Create a new project. +* `mkdocs serve` - Start the live-reloading docs server. +* `mkdocs build` - Build the documentation site. +* `mkdocs -h` - Print help message and exit. + +## Project layout + + mkdocs.yml # The configuration file. + docs/ + index.md # The documentation homepage. + ... # Other markdown pages, images and other files. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000..04381ed --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,3 @@ +site_name: My Docs +theme: + name: material \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6dc5687..1e90e85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,6 +106,14 @@ all = [ "typing", ] +[tool.hatch.envs.docs] +detached = true +dependencies = [ + "mkdocs-material>=9.4.0", +] +[tool.hatch.envs.docs.scripts] +build = "mkdocs build -f docs/mkdocs.yml" +serve = "mkdocs serve -f docs/mkdocs.yml" [tool.black] target-version = ["py310"]