Skip to content
Closed
33 changes: 28 additions & 5 deletions .github/actions/build-pdf/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,34 @@ runs:
id: get_release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
run: |
RELEASE=$(gh release view --json tagName --jq .tagName || echo "")
RELEASE=$(gh release view --json tagName --jq .tagName 2>/dev/null || true)
if [ -z "$RELEASE" ]; then
RELEASE="0.0.0-dev"
fi
echo "LATEST_RELEASE=$RELEASE" >> $GITHUB_ENV
- name: Put current date into a variable
shell: bash
run: echo "EXPORT_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
- name: Load title page translations
shell: bash
env:
DOC_LANG: ${{ inputs.lang }}
TRANSLATIONS_FILE: ./scripts/titlepage_translations.json
run: |
python3 - <<'PY' >> "$GITHUB_ENV"
import json, os
path = os.environ['TRANSLATIONS_FILE']
lang = os.environ.get('DOC_LANG', 'en')
with open(path) as f:
data = json.load(f)
default = data.get('en', {})
trans = data.get(lang, default)
for key in ['title', 'subtitle', 'author', 'written_by', 'release_prefix']:
val = trans.get(key, default.get(key, ''))
print(f"{key.upper()}={val}")
PY
- name: Build PDF
uses: docker://pandoc/extra
with:
Expand Down Expand Up @@ -94,9 +115,11 @@ runs:
--verbose
-V mainfont="Source Sans Pro"
-V sansfont="Source Sans Pro"
-V title="Q Light Controller + Documentation"
-V subtitle="Comprehensive Guide"
-V author="docs.qlcplus.org"
-V title="${{ env.TITLE }}"
-V subtitle="${{ env.SUBTITLE }}"
-V author="${{ env.AUTHOR }}"
-V written_by="${{ env.WRITTEN_BY }}"
-V release_prefix="${{ env.RELEASE_PREFIX }}"
-V date="${{ env.EXPORT_DATE }}"
-V release="${{ env.LATEST_RELEASE }}"
- name: Combine Title Page and Documentation PDFs
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: spellcheck
name: documentation
on:
push:
pull_request:
Expand All @@ -14,25 +14,44 @@ jobs:
config_path: .spellcheck.yml
task_name: Markdown

detect-langs:
runs-on: ubuntu-latest
outputs:
langs: ${{ steps.setlangs.outputs.langs }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- id: setlangs
run: |
langs=$(find pages -name '*_??.md' | sed -n 's/.*_\([A-Za-z][A-Za-z]\)\.md/\1/p' | tr '[:upper:]' '[:lower:]' | sort -u)
langs="en $langs"
json=$(printf '%s\n' $langs | jq -R . | jq -sc .)
echo "langs=$json" >> "$GITHUB_OUTPUT"

build-pdf:
needs: detect-langs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lang: ${{ fromJson(needs.detect-langs.outputs.langs) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- id: build
uses: ./.github/actions/build-pdf
with:
lang: en
lang: ${{ matrix.lang }}

- name: Upload-PDF
uses: actions/upload-artifact@v4
with:
name: qlcplus-docs-en-pdf
name: qlcplus-docs-${{ matrix.lang }}-pdf
path: ./.github/workflows/bin/pdf/
- name: Upload-Markdown
uses: actions/upload-artifact@v4
with:
name: qlcplus-docs-en-markdown
path: ./.github/workflows/bin/markdown/

# - name: Upload-Markdown
# uses: actions/upload-artifact@v4
# with:
# name: qlcplus-docs-${{ matrix.lang }}-markdown
# path: ./.github/workflows/bin/markdown/
21 changes: 20 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,28 @@ permissions:
contents: write

jobs:
detect-langs:
runs-on: ubuntu-latest
outputs:
langs: ${{ steps.setlangs.outputs.langs }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- id: setlangs
run: |
langs=$(find pages -name '*_??.md' | sed -n 's/.*_\([A-Za-z][A-Za-z]\)\.md/\1/p' | tr '[:upper:]' '[:lower:]' | sort -u)
langs="en $langs"
json=$(printf '%s\n' $langs | jq -R . | jq -sc .)
echo "langs=$json" >> "$GITHUB_OUTPUT"

build_release:
needs: detect-langs
name: build_release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lang: ${{ fromJson(needs.detect-langs.outputs.langs) }}
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -36,7 +55,7 @@ jobs:
- id: build
uses: ./.github/actions/build-pdf
with:
lang: en
lang: ${{ matrix.lang }}

- name: Upload PDF asset to release
env:
Expand Down
2 changes: 1 addition & 1 deletion pages/10.fixture-definition-editor/chapter.v4_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Um Ihre Fixture-Definitionen in QLC+ zu verwenden, müssen Sie sie an einem Ort
1. Im selben Ordner wie Ihr QLC+-Arbeitsbereich (praktisch, wenn Sie Ihren Arbeitsbereich jemand anderem geben möchten)
2. Im Benutzer-Fixtures-Ordner an folgenden Orten:
* Linux: Es handelt sich um einen versteckten Ordner in Ihrem Benutzer-Home-Verzeichnis: „$HOME/.qlcplus/Fixtures“.
* Windows: Es ist ein Ordner in Ihrem Benutzerverzeichnis: C:\\Benutzer\{Benutzername}\QLC+\Fixtures.
* Windows: Es ist ein Ordner in Ihrem Benutzerverzeichnis: `C:\\Benutzer\\<Benutzername>\\QLC+\\Fixtures`.
* Mac OS: Es befindet sich in Ihrem Benutzerbibliotheksverzeichnis: „$HOME/Library/Application\\ Support/QLC+/Fixtures“.

**Wichtiger Hinweis: Sie sollten Ihre benutzerdefinierten Geräte NICHT im Geräteordner des QLC+-Systems speichern oder kopieren. Dies liegt daran, dass bei der Deinstallation von QLC+ alle Geräte in diesem Ordner gelöscht werden. Es kann auch zu unbeabsichtigten Konflikten zwischen dem System und Ihren eigenen Gerätedefinitionen kommen.**
Expand Down
2 changes: 1 addition & 1 deletion pages/11.advanced/05.custom-ui-style/default.v4_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Der Dateiname ist in QLC+ fest codiert und muss lauten: „qlcplusStyle.qss“.
Die Stildatei muss außerdem in einem bestimmten Pfad abgelegt werden:

* **Linux**: `$HOME/.qlcplus`
* **Windows**: C:\\Benutzer\{Benutzername}\QLC+.
* **Windows**: `C:\\Benutzer\\<Benutzername>\\QLC+`.
* **OSX**: `$HOME/Library/Application\\ Support/QLC+`

Die Theme-Datei ist in Abschnitte unterteilt. Jeder Abschnitt stellt die UI-Elemente dar, die beim Ausführen von QLC+ geändert werden. Unveränderte Abschnitte können weggelassen werden.
Expand Down
4 changes: 2 additions & 2 deletions scripts/Merge-MarkdownFiles.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param([string]$Lang="EN")
$Lang = $Lang.ToUpper()
param([string]$Lang="en")
$Lang = $Lang.ToLower()

function Update-MarkdownHeadingLevels {
param (
Expand Down
4 changes: 2 additions & 2 deletions scripts/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
% Conditional release rendering
\ifx\release\empty
\else
{\Huge \textit{Release: $release$}} \\
{\Huge \textit{$release_prefix$ $release$}} \\
\fi
\vfill
% Custom "Written by..." message above the author
\ifx\author\empty
\else
{\Large \textit{Written by... you!}} \\ % Custom message
{\Large \textit{$written_by$}} \\ % Custom message
{\Large $author$} \\ % Author's name
\fi
\vfill
Expand Down
23 changes: 23 additions & 0 deletions scripts/titlepage_translations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"en": {
"title": "Q Light Controller + Documentation",
"subtitle": "Comprehensive Guide",
"author": "docs.qlcplus.org",
"written_by": "Written by... you!",
"release_prefix": "Release:"
},
"de": {
"title": "Q Light Controller + Dokumentation",
"subtitle": "Umfassender Leitfaden",
"author": "docs.qlcplus.org",
"written_by": "Geschrieben von... dir!",
"release_prefix": "Version:"
},
"ca": {
"title": "Documentació de Q Light Controller +",
"subtitle": "Guia completa",
"author": "docs.qlcplus.org",
"written_by": "Escrit per... tu!",
"release_prefix": "Versió:"
}
}