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

update MkDocs + static i18n plugin #879

Merged
merged 12 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "pip"
directory: "docs/"
schedule:
interval: "monthly"
41 changes: 32 additions & 9 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
name: doc
on:
pull_request:
branches:
- master
paths:
- 'docs/**'
- '.github/workflows/doc.yml'
push:
branches:
- master
paths:
- 'docs/**'
- '.github/workflows/doc.yml'
workflow_dispatch: # useful for testing tx pushes
workflow_call:

permissions:
contents: write

defaults:
run:
working-directory: docs

jobs:
deploy:
Expand All @@ -16,40 +31,48 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Checkout Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Python requirements
run: pip install -r ./docs/.utils/requirements.txt
run: pip install -r requirements.txt

- name: Install Transifex client
run: |
curl -OL https://github.com/transifex/cli/releases/download/v1.6.10/tx-linux-amd64.tar.gz
tar -xvzf tx-linux-amd64.tar.gz

- name: Configure Transifex
run: |
python ./docs/.utils/transifex_utils.py
run: scripts/transifex_utils.py
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

- name: Push source files to Transifex
run: |
./tx push
if: ${{ github.event_name == 'push' }}
signedav marked this conversation as resolved.
Show resolved Hide resolved
run: ./tx push
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

- name: Pull translations from Transifex
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'opengisch/QgisModelBaker' }}
run: |
./tx pull --translations --all --minimum-perc 10
./tx status
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

- name: Build docs
- name: Build documentation
signedav marked this conversation as resolved.
Show resolved Hide resolved
run: mkdocs build

- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: docs
path: docs/site
if-no-files-found: error

- name: Deploy to GitHub Pages
if: ${{ github.event_name == 'push' }}
run: mkdocs gh-deploy --force
File renamed without changes.
5 changes: 0 additions & 5 deletions docs/.utils/requirements.txt

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ After the installation you can find all the Features in the *Database > Model Ba
The wizard contains all the functionalities to create database schemas from INTERLIS models, import / export transferdata and generate QGIS projects from the database. It leads you through the process with all the possiblities you have with the single dialogs. Find a guide through the [import and generate process with the wizard](../import_workflow/) and through the [export process with the wizard](../export_workflow/) in this documentation.

### Data Validator
The Data Validator provides you the possiblity to check the data currently open in your QGIS against an INTERLIS model. You can open the validator panel as well over *View > Panels > Model Baker Data Validator*. See for more information about it [Validate Data](../user_guide/validation.md)
The Data Validator provides you the possiblity to check the data currently open in your QGIS against an INTERLIS model. You can open the validator panel as well over *View > Panels > Model Baker Data Validator*. See for more information about it [Validate Data]()
signedav marked this conversation as resolved.
Show resolved Hide resolved

### Dataset Manager
The dataset manager provides you the possiblity to create and rename datasets and generate the baskets for the datasets. More information you can find in the [Dataset and Basket Handling](../background_info/basket_handling.md)
Expand Down
File renamed without changes.
52 changes: 29 additions & 23 deletions mkdocs.yml → docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Project information
site_name: QGIS Model Baker Documenation
site_name: QGIS Model Baker Documentation
site_description: >-
This site contains documentation about QGIS Model Baker
site_url: https://opengisch.github.io/QgisModelBaker/

docs_dir: docs

# Repository
repo_name: opengisch/QgisModelBaker
repo_url: https://github.com/opengisch/QgisModelBaker
Expand All @@ -12,7 +14,7 @@ edit_uri: https://github.com/opengisch/QgisModelBaker/tree/master/docs/
# Theme configuration
theme:
name: material
custom_dir: docs/theme_overrides/
custom_dir: theme_overrides/
features:
- navigation.tabs
- navigation.tabs.sticky
Expand Down Expand Up @@ -65,25 +67,29 @@ markdown_extensions:

plugins:
- i18n:
default_language: en
languages:
en: English
de: Deutsch
nav_translations:
de:
User Guide: Benutzerhandbuch
Get Started: Loslegen
Model and Data Import Workflow: Modell und Daten Import Workflow
Export Data Workflow: Daten Export Workflow
Validate Data: Daten Validierung
Plugin Configuration: Plugin Konfiguration
Repositories: Repositories
Basket and Dataset Handling: Dataset und Basket Handling
OID Generator: OID Generator
Optimized Projects for Extended Models : Optimierte Projekte für erweiterte Modelle
Model Baker Integration: Model Baker Integration
Technical Concept: Technisches Konzept
Catalogues and their special cases: Kataloge und ihre Spezialfälle
Meta Attributes: Metaattribute
Migrate from ili2db 3 to 4: Migration von ili2db 3 zu 4
Development: Enwicklung
- locale: en
default: true
name: English
site_name: QGIS Model Baker Documentation

- locale: de
name: Deutsch
site_name: QGIS Model Baker Dokumentation
nav_translations:
User Guide: Benutzerhandbuch
Get Started: Loslegen
Model and Data Import Workflow: Modell und Daten Import Workflow
Export Data Workflow: Daten Export Workflow
Validate Data: Daten Validierung
Plugin Configuration: Plugin Konfiguration
Repositories: Repositories
Basket and Dataset Handling: Dataset und Basket Handling
OID Generator: OID Generator
Optimized Projects for Extended Models : Optimierte Projekte für erweiterte Modelle
Model Baker Integration: Model Baker Integration
Technical Concept: Technisches Konzept
Catalogues and their special cases: Kataloge und ihre Spezialfälle
Meta Attributes: Metaattribute
Migrate from ili2db 3 to 4: Migration von ili2db 3 zu 4
Development: Enwicklung
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdocs-material==9.5.9
mkdocs-static-i18n==1.2.0
python-slugify
8 changes: 5 additions & 3 deletions docs/.utils/transifex_utils.py → docs/scripts/transifex_utils.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import glob
import os

Expand All @@ -16,15 +18,15 @@ def create_transifex_config():
print("Start creating transifex configuration")

current_dir = os.path.dirname(os.path.abspath(__file__))
config_file = os.path.join(current_dir, "..", "..", ".tx", "config")
root = os.path.join(current_dir, "..", "..")
config_file = os.path.join(current_dir, "..", ".tx", "config")
root = os.path.join(current_dir, "..")
count = 0

with open(config_file, "w") as f:
f.write("[main]\n")
f.write("host = https://www.transifex.com\n\n")

for file in glob.iglob(current_dir + "/../**/*.md", recursive=True):
for file in glob.iglob(current_dir + "/../docs/**/*.md", recursive=True):
# Get relative path of file
relative_path = os.path.relpath(file, start=root)

Expand Down
Loading