Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs #31

Merged
merged 30 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
49d476a
Initial docs layout (draft)
lkubb Aug 17, 2024
185b81b
Allow specifying options for sphinx-autobuild
lkubb Aug 17, 2024
7d9b190
Remove parametrization of docs-dev nox task
lkubb Aug 18, 2024
3721ab2
Simplify test for host arg
lkubb Aug 18, 2024
788428c
Fix conf.py setup
lkubb Aug 18, 2024
99ad077
Add basic testing docs
lkubb Aug 19, 2024
80a557a
Add more remarks
lkubb Aug 19, 2024
3e27ab5
Some fixes/improvements for testing doc
lkubb Aug 19, 2024
de8f6c4
Add more drafts
lkubb Aug 20, 2024
1e2f8d7
Improve docs writing docs
lkubb Aug 20, 2024
013d2c9
Correct cross-ref hint
lkubb Aug 20, 2024
b6ee308
Add updating docs
lkubb Aug 20, 2024
bce0c96
Minor fixes/improvements
lkubb Aug 20, 2024
221747d
Add missing topics, many small improvements
lkubb Aug 21, 2024
7e365fd
Readd important considerations, small fixes
lkubb Aug 21, 2024
e6881a0
Add some historical context
max-arnold Aug 20, 2024
b23891b
Describe the module extraction process
max-arnold Aug 20, 2024
a6a6d83
Address the review suggestions
max-arnold Aug 21, 2024
cf29c25
A couple of testing tips
max-arnold Aug 21, 2024
77af26b
Add clarification on how to build changelog to documenting/changelog
lkubb Aug 26, 2024
8925080
Adjust extraction example
lkubb Aug 25, 2024
a856309
Add salt-extension-migrate, rework common issues
lkubb Aug 26, 2024
ac36d0f
Correct installation examples
lkubb Aug 26, 2024
3f96b7e
Add venv note to pip installations
lkubb Aug 27, 2024
b6ec4df
Add explicit targets for extraction steps
lkubb Aug 27, 2024
029bce1
Improve language, add tippy
lkubb Aug 27, 2024
b2a2446
Address comments
lkubb Aug 27, 2024
5133a59
Fix CSS
lkubb Aug 27, 2024
88cdbe3
Minor adjustments
lkubb Aug 27, 2024
5fbd6f8
Update README
lkubb Aug 27, 2024
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
62 changes: 40 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ jobs:
- pre-commit
uses: ./.github/workflows/test-action.yml

docs:
name: Docs
needs:
- pre-commit
uses: ./.github/workflows/docs-action.yml

deploy-docs:
name: Deploy Docs
uses: ./.github/workflows/deploy-docs-action.yml
# Only build doc deployments from the main branch of the org repo and never for PRs.
if: >-
github.event_name != 'pull_request' &&
github.ref == 'refs/heads/main'
needs:
- docs
- test

set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks
# on a pull request instead of requiring all
Expand All @@ -41,29 +58,30 @@ jobs:
if: always()
needs:
- test
- docs
steps:
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@v4
with:
path: exitstatus
pattern: exitstatus-*
merge-multiple: true
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@v4
with:
path: exitstatus
pattern: exitstatus-*
merge-multiple: true

- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@v5
with:
name: exitstatus-*
useGlob: true
failOnError: false
- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@v5
with:
name: exitstatus-*
useGlob: true
failOnError: false

- name: Set Pipeline Exit Status
run: |
tree exitstatus
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0
- name: Set Pipeline Exit Status
run: |
tree exitstatus
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0

- name: Done
if: always()
run:
echo "All workflows finished"
- name: Done
if: always()
run:
echo "All workflows finished"
76 changes: 76 additions & 0 deletions .github/workflows/deploy-docs-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Publish Documentation

on:
workflow_call:
inputs:
# This is the name of the regular artifact that should
# be transformed into a GitHub Pages deployment.
artifact-name:
type: string
required: false
default: html-docs

jobs:

# The released docs are not versioned currently, only the latest ones are deployed.
#
# Versioning support would require either (better):
# * Rebuilding docs for all versions when a new release is made
# * Version selector support in `furo`: https://github.com/pradyunsg/furo/pull/500
#
# or (more basic):
# * using the `gh-pages` branch and peaceiris/actions-gh-pages
# to be able to deploy to subdirectories. The implementation via
# actions/deploy-pages always replaces the directory root.

Deploy-Docs-GH-Pages:
name: Publish Docs to GitHub Pages

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
pages: write
id-token: write

runs-on: ubuntu-latest
steps:
- name: Download built docs
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: html-docs

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
name: html-docs-pages
path: html-docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: html-docs-pages

- name: Delete GitHub Pages artifact
if: always()
uses: geekyeggo/delete-artifact@v5
with:
name: html-docs-pages
failOnError: false

- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}

- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v4
with:
name: exitstatus-${{ github.job }}
path: exitstatus
if-no-files-found: error
52 changes: 52 additions & 0 deletions .github/workflows/docs-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Documentation

on:
workflow_call:

jobs:
Docs:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12 For Nox
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox

- name: Install Doc Requirements
run: |
nox --force-color -e docs --install-only

- name: Build Docs
env:
SKIP_REQUIREMENTS_INSTALL: true
run: |
nox --force-color -e docs

- name: Upload built docs as artifact
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/_build/html

- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}

- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v4
with:
name: exitstatus-${{ github.job }}
path: exitstatus
if-no-files-found: error
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ jobs:
uses: ./.github/workflows/ci.yml
permissions:
contents: write
pages: write
id-token: write
pull-requests: read
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

This project uses [Semantic Versioning](https://semver.org/) - MAJOR.MINOR.PATCH

# Changelog
15 changes: 15 additions & 0 deletions changelog/.template.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% if sections[""] %}
{% for category, val in definitions.items() if category in sections[""] %}

### {{ definitions[category]['name'] }}

{% for text, values in sections[""][category].items() %}
- {{ text }} {{ values|join(', ') }}
{% endfor %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18 changes: 18 additions & 0 deletions docs/_ext/saltdomain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Copied/distilled from Salt doc/_ext/saltdomain.py in order to be able
to use Salt's custom doc refs.
"""


def setup(app):
app.add_crossref_type(
directivename="conf_master",
rolename="conf_master",
indextemplate="pair: %s; conf/master",
)
app.add_crossref_type(
directivename="conf_minion",
rolename="conf_minion",
indextemplate="pair: %s; conf/minion",
)
return {"parallel_read_safe": True, "parallel_write_safe": True}
Empty file added docs/_static/.gitkeep
Empty file.
Loading