Skip to content

Commit

Permalink
Merge pull request #105 from Gothic-Modding-Community/dev
Browse files Browse the repository at this point in the history
Dev -> Main merge
  • Loading branch information
auronen authored Feb 9, 2024
2 parents 16ef42a + 271c8db commit c1e0ab0
Show file tree
Hide file tree
Showing 147 changed files with 16,086 additions and 726 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/dev.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,48 @@ on:

env:
GMC_ENABLE_ON_PUBLISH: true
GMC_DEV_URL: 'https://auronen.cokoliv.eu/gmc/'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Number of commits to fetch. 0 indicates all history.
# Default: 1
# 0 is needed for the update time plugin to work properly
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: pip
- name: Cache `requirements.txt`
- name: Process Python Cache
id: cache-requirements
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/venv/*'
key: requirements-${{ hashFiles('**/requirements*.txt') }}
- name: Install Dependencies into `venv`
path: venv
key: requirements-${{ hashFiles('requirements*.txt') }}
- name: Install Uncached Requirements
if: steps.cache-requirements.outputs.cache-hit != 'true'
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-deploy.txt
- name: Run prebuild tests
run: |
source venv/bin/activate
python -m unittest discover tests/ -v
- name: Process MkDocs Plugins & Hooks Cache
uses: actions/cache@v4
with:
path: .cache
key: mkdocs-${{ github.sha }}
restore-keys: |
mkdocs-
- name: Build and deploy site
run: |
source venv/bin/activate
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/master.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,41 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Number of commits to fetch. 0 indicates all history.
# Default: 1
# 0 is needed for the update time plugin to work properly
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: pip
- name: Cache `requirements.txt`
- name: Process Python Cache
id: cache-requirements
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/venv/*'
key: requirements-${{ hashFiles('**/requirements*.txt') }}
- name: Install Dependencies into `venv`
path: venv
key: requirements-${{ hashFiles('requirements*.txt') }}
- name: Install Uncached Requirements
if: steps.cache-requirements.outputs.cache-hit != 'true'
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-deploy.txt
- name: Run prebuild tests
run: |
source venv/bin/activate
python -m unittest discover tests/ -v
- name: Process MkDocs Plugins & Hooks Cache
uses: actions/cache@v4
with:
path: .cache
key: mkdocs-${{ github.sha }}
restore-keys: |
mkdocs-
- name: Build and deploy site
run: |
source venv/bin/activate
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/pull.request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Number of commits to fetch. 0 indicates all history.
# Default: 1
# 0 is needed for the update time plugin to work properly
fetch-depth: 1
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: pip
- name: Cache `requirements.txt`
- name: Process Python Cache
id: cache-requirements
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/venv/*'
key: requirements-${{ hashFiles('**/requirements*.txt') }}
- name: Install Dependencies into `venv`
path: venv
key: requirements-${{ hashFiles('requirements*.txt') }}
- name: Install Uncached Requirements
if: steps.cache-requirements.outputs.cache-hit != 'true'
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-deploy.txt
- name: Run prebuild tests
run: |
source venv/bin/activate
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ __pycache__/
/drafts/

# Social Plugin image cache
.cache/
.cache/

# VS Code config files
.vscode/
1 change: 1 addition & 0 deletions docs/.pages
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
nav:
- Home:
- ... | index*.md
- ... | preferences*.md
- zengin
- genome
- contribute
14 changes: 7 additions & 7 deletions docs/contribute/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,25 +188,25 @@ In order to work locally:
#### Build preferences
While working with the project, it's possible to set various environmental variables to configure it to your own preferences:
- `GMC_DEFAULT_LANG` - is a 2-character language identifier (it must be present in the `mkdocs.yml` file), it sets the default language of the site
- `GMC_ONLY_DEFAULT_LANG` - `True` or `False` value, activates the site build to be only in the default language
- `GMC_DEV_LOCALE` - is a 2-character language identifier (ex. `en`, `pl`), it sets the development language of the site. This will enforce that language to be the default and only built language. Helps to decrease build time and allows to easily change the language without modyfying the config file. **Because of changes in the `mkdocs-static-i18n` plugin, this is the only way to temporarily change the default language**
- `GMC_BUILD_ALTERNATES` - `True` or `False` value, activates the site build to also include alternate languages apart of the default language. Default behaviour is to omit alternates to decrease build time.
- `GMC_ENABLE_ON_PUBLISH` - `True` or `False` value, activates all of the final build procedures, like adding of the last modified date, minifying of the resources etc.
Environmental variables can be set temporarily for the currently open Terminal window:
```bash title="Linux"
export GMC_DEFAULT_LANG=en export GMC_ONLY_DEFAULT_LANG=True; mkdocs serve
export GMC_DEV_LOCALE=en export GMC_BUILD_ALTERNATES=False; mkdocs serve
```
```powershell title="Windows Powershell"
$env:GMC_DEFAULT_LANG="en"
$env:GMC_ONLY_DEFAULT_LANG="True"
$env:GMC_DEV_LOCALE="en"
$env:GMC_BUILD_ALTERNATES="False"
mkdocs serve
```
```batch title="Windows Command Prompt (cmd)"
set GMC_DEFAULT_LANG=en
set GMC_ONLY_DEFAULT_LANG=True
set GMC_DEV_LOCALE=en
set GMC_BUILD_ALTERNATES=False
mkdocs serve
```
Expand Down
14 changes: 7 additions & 7 deletions docs/contribute/index.pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,25 +188,25 @@ Aby móc pracować lokalnie:
#### Preferencje budowy strony
Podczas pracy z projektem można ustawić różne zmienne środowiskowe, żeby przystosować konfigurację do własnych preferencji:

- `GMC_DEFAULT_LANG` - to dwuznakowy identyfikator języka (musi być obecny w pliku `mkdocs.yml`), ustawia domyślny język strony
- `GMC_ONLY_DEFAULT_LANG` - wartość `True` albo `False`, aktywuje budowanie strony wyłącznie w domyślnym języku
- `GMC_DEV_LOCALE` - to dwuznakowy identyfikator języka (np. `en`, `pl`), ustawia język testowy. To ustawi ten języki jako domyślny oraz jedyny renderowany podczas budowy strony. Pomaga w zmniejszeniu czasu budowy strony oraz pozwala na łatwe zmienianie języka zamiast modyfikowania pliku konfiguracyjnego. **Przez zmiany w pluginie `mkdocs-static-i18n` jest to jedyny sposób na tymczasową zmianę domyślnego języka**
- `GMC_BUILD_ALTERNATES` - wartość `True` albo `False`, aktywuje budowanie strony wraz z alternatywnymi językami. Domyślnie alternatywne języki są pomijane, aby zmenijszyć czas budowy strony.
- `GMC_ENABLE_ON_PUBLISH` - wartość `True` albo `False`, aktywuje wszystkie finalne procesy, jak dodanie daty ostatniej aktualizacji, minimalizacja zasobów itp.

Dla otwartego okna poleceń można tymczasowo je ustawić:

```bash title="Linux"
export GMC_DEFAULT_LANG=en export GMC_ONLY_DEFAULT_LANG=True; mkdocs serve
export GMC_DEV_LOCALE=en export GMC_BUILD_ALTERNATES=False; mkdocs serve
```

```powershell title="Windows Powershell"
$env:GMC_DEFAULT_LANG="en"
$env:GMC_ONLY_DEFAULT_LANG="True"
$env:GMC_DEV_LOCALE="en"
$env:GMC_BUILD_ALTERNATES="False"
mkdocs serve
```

```batch title="Windows Konsola Poleceń (cmd)"
set GMC_DEFAULT_LANG=en
set GMC_ONLY_DEFAULT_LANG=True
set GMC_DEV_LOCALE=en
set GMC_BUILD_ALTERNATES=False
mkdocs serve
```

Expand Down
2 changes: 1 addition & 1 deletion docs/genome/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Piranha Bytes did not release a modkit for their Genome engine, but the modding
This page is under construction, for now, only handful of links are present.

## Gothic 3 SDK
Georgeto, inspired by NiceDE's Risen SDK, has created an SDK for Gothic 3. It can be used to manipulate the engine in the similar way Union is able to manipulate ZenGin.
Georgeto, inspired by NicoDE's Risen SDK, has created an SDK for Gothic 3. It can be used to manipulate the engine in the similar way Union is able to manipulate ZenGin.
[GitHub repository](https://github.com/georgeto/gothic3sdk)
92 changes: 92 additions & 0 deletions docs/preferences.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
preferences_i18n:
en:
page-title: "Preferences"
page-description: "This page allows to set various preferences for reading the docs:"
color-title: "Color"
color-description: "You can change the feel of the site with a color change."
color-input-accent-title: "Select accent color"
color-input-hue-title: "Select hue color"
color-button-reset: "Reset colors"
custom-title: "Custom CSS"
custom-description: "You can add custom stylesheets."
custom-textarea-title: "Input CSS"
font-title: "Font"
font-description: "You can change the font to another preset."
font-selection-title: "Select font"
font-selection-default: "Default"
font-selection-opendyslexic: "OpenDyslexic"
heading-shadows-title: "Heading shadows"
heading-shadows-description: "You can enable additional shadows for the heading to make them appear more bold."
pl:
page-title: "Preferencje"
page-description: "Ta strona pozwala ustawić różne preferencje do czytania dokumentacji:"
color-title: "Kolor"
color-description: "Możesz zmienić nastrój strony poprzez zmianę koloru."
color-input-accent-title: "Wybierz kolor akcentujący"
color-input-hue-title: "Wybierz kolor odcienia"
color-button-reset: "Zresetuj kolory"
custom-title: "Własny CSS"
custom-description: "Możesz dodać niestandardowe arkusze stylów."
custom-textarea-title: "Wprowadź CSS"
font-title: "Czcionka"
font-description: "Możesz zmienić czcionkę na predefiniowany."
font-selection-title: "Wybierz czcionkę"
font-selection-default: "Domyślna"
font-selection-opendyslexic: "OpenDyslexic"
heading-shadows-title: "Cienie nagłówków"
heading-shadows-description: "Możesz włączyć dodatkowe cienie do nagłówków żeby wyglądały bardziej pogrubione."
---
# {{ page-title }}

{{ page-description }}

## {{ color-title }}

{{ color-description }}

<label for="preference-color-accent">{{ color-input-accent-title }}:</label>
<input
data-option="color"
data-extra="accent"
id="preference-color-accent"
name="preference-color-accent"
title="{{ color-input-accent-title }}"
type="color">

<label for="preference-color-hue">{{ color-input-hue-title }}:</label>
<input
data-option="color"
data-extra="hue"
id="preference-color-hue"
name="preference-color-hue"
title="{{ color-input-hue-title }}"
type="color">

[{{ color-button-reset }} :fontawesome-regular-circle-xmark:](#preference-color-reset){ #preference-color-reset .md-button data-extra="reset" data-option="color" title="{{ color-button-reset }}" }

## {{ font-title }}

{{ font-description }}

<label for="preference-font">{{ font-selection-title }}:</label>
<select data-option="font" id="preference-font" name="preference-font" title="{{ font-selection-title }}">
<option value="default">{{ font-selection-default }}</option>
<option value="opendyslexic">{{ font-selection-opendyslexic }}</option>
</select>

## {{ custom-title }}

{{ custom-description }} <label for="preference-custom">{{ custom-textarea-title }}:</label>
<p>
<textarea
class="md-input--stretch"
data-option="custom"
id="preference-custom"
name="preference-custom"
style="resize: none; height: 10em"
title="{{ custom-textarea-title }}">
</textarea>
</p>

<script src="/gmc/assets/javascripts/preferences.js"></script>
Loading

0 comments on commit c1e0ab0

Please sign in to comment.