Skip to content

Commit

Permalink
Saving work
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpylog committed Dec 18, 2023
1 parent 3d42617 commit 2a2802c
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ updates:
# Enable version updates for Python
- package-ecosystem: "pip"
target-branch: "develop"
# Look for a `Pipfile` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
Expand Down
43 changes: 42 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,48 @@ jobs:
path: dist/*
if-no-files-found: error
retention-days: 7

documentation:
name: Documentation
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- lint
steps:
-
uses: actions/checkout@v4
-
name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
-
name: Install Hatch
run: |
pip3 --quiet install --upgrade hatch
-
name: Build Documentation
run: |
hatch run docs:build
-
uses: actions/upload-artifact@v3
with:
name: documentation
path: site/*
if-no-files-found: error
retention-days: 7
-
name: Configure Git user
if: startsWith(github.ref, 'refs/tags/')
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
-
name: Deploy documentation
if: startsWith(github.ref, 'refs/tags/')
run: |
hatch run docs:deploy ${{ github.ref_name }}
create-release:
name: Release
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ venv/

# Possible PDF generated from testing
tests/outputs/**

# Documentation site
site/
8 changes: 8 additions & 0 deletions docs/.override/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "base.html" %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 21 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
site_name: Gotenberg Client

site_url: https://stumpylog.github.io/gotenberg-client/
site_author: Trenton H

repo_name: stumpylog/gotenberg-client
repo_url: https://github.com/stumpylog/gotenberg-client

markdown_extensions:
- admonition

plugins:
- search

theme:
name: material
custom_dir: docs/.override

extra:
version:
provider: mike
24 changes: 23 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies = [
]

[project.urls]
Documentation = "https://github.com/stumpylog/gotenberg-client/#readme"
Documentation = "https://stumpylog.github.io/gotenberg-client/"
Issues = "https://github.com/stumpylog/gotenberg-client/issues"
Source = "https://github.com/stumpylog/gotenberg-client/"
Changelog = "https://github.com/stumpylog/gotenberg-client/blob/main/CHANGELOG.md"
Expand Down Expand Up @@ -95,6 +95,28 @@ dependencies = [
check = ["pre-commit run --all-files"]
update = ["pre-commit autoupdate"]

[tool.hatch.envs.docs]
template = "docs"
detached = true
dependencies = [
"mkdocs-material~=9.5.2",
"mike~=2.0.0"
]

[tool.hatch.envs.docs.scripts]
new = ["mkdocs new ."]
build = ["mkdocs build"]
serve = [
"mike deploy latest",
"mike set-default latest",
"mike serve"
]
mike-help = ["mike set-default --help"]
deploy = [
"mike deploy --push --branch gh-pages --remote origin --update-aliases latest {args}",
"mike set-default --branch gh-pages --remote origin --push latest"
]

[tool.hatch.envs.lint]
detached = true
dependencies = [
Expand Down

0 comments on commit 2a2802c

Please sign in to comment.