diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..f44c4c8 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,55 @@ +# Every push to main that changes the user guide: build the website from docs (mkdocs.yml) and publish it to +# GitHub Pages (https://flysimdev.github.io/OrthoStreamXP/). Settings > Pages > Source must be "GitHub Actions". +name: User guide website + +on: + push: + branches: [main] + paths: + - 'docs/**' + - 'mkdocs.yml' + - '.github/workflows/pages.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# One deployment at a time; a newer push waits rather than cancelling one that is publishing. +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + cache: pip + cache-dependency-path: docs/requirements.txt + + - name: Install MkDocs + run: pip install -r docs/requirements.txt + + # --strict: a broken link between pages fails the build, and the published site stays as it was. + - name: Build + run: mkdocs build --strict + + - uses: actions/upload-pages-artifact@v3 + with: + path: site + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 8194c12..fb7a75c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ temp_scripts/ artifacts/ TestResults/ .vscode +site/ diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..948c9be --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +mkdocs==1.6.1 +mkdocs-material==9.6.14 diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..5823867 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,52 @@ +# The user guide website (GitHub Pages), built from the pages in docs by .github/workflows/pages.yml. +# Preview locally: pip install -r docs/requirements.txt, then python -m mkdocs serve (http://127.0.0.1:8000). +site_name: OrthoStreamXP user guide +site_description: Streamed photo scenery for X-Plane 12 +site_url: https://flysimdev.github.io/OrthoStreamXP/ +repo_url: https://github.com/flysimdev/OrthoStreamXP +repo_name: flysimdev/OrthoStreamXP +edit_uri: edit/main/docs/ + +docs_dir: docs +# The PDF's stylesheet and the site's build requirements are not pages. +exclude_docs: | + user-guide.css + requirements.txt + +# The same order as the guide's contents (docs/README.md) and build-user-guide.ps1. +nav: + - Home: README.md + - installation.md + - first-setup.md + - flying.md + - settings.md + - cache.md + - troubleshooting.md + - Questions and answers: faq.md + - User guide (PDF): OrthoStreamXP-UserGuide.pdf + +theme: + name: material + features: + - navigation.instant + - navigation.top + - toc.follow + - search.highlight + - content.action.edit + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/weather-night + name: Dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/weather-sunny + name: Light mode + +markdown_extensions: + - admonition + - attr_list + - toc: + permalink: true