Skip to content

Commit

Permalink
Update docs (#184)
Browse files Browse the repository at this point in the history
add tabs
CI cleanup, remove extra deps
update deps incl. insiders
  • Loading branch information
3nids authored Feb 13, 2024
1 parent 83623ab commit e7bd171
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 34 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: 🚧 Website MkDocs
on:
pull_request:
branches:
- master
paths:
- 'website/**'
- '.github/workflows/website.yml'
push:
branches:
- master
# - website*
- website*
paths:
- 'website/**'
- '.github/workflows/website.yml'
Expand All @@ -18,7 +24,7 @@ defaults:
working-directory: website

jobs:
deploy:
website:
runs-on: ubuntu-latest
# Skip if this job was scheduled and the runner belongs to a fork (i.e. forks have no use for this action)
if: (github.event_name == 'schedule' && github.repository == 'opengisch/QField-docs') || (github.event_name != 'schedule')
Expand Down Expand Up @@ -47,14 +53,13 @@ jobs:
tar -xvzf tx-linux-amd64.tar.gz
- name: Configure Transifex
run: |
python ./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' }}
run: ./tx push
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}

Expand All @@ -77,7 +82,15 @@ jobs:
unzip -q signalo-${LATEST_RELEASE}-model-documentation.zip
cp -r model-documentation site/
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: website
path: website/site
if-no-files-found: error

- name: Deploy to GitHub Pages
if: ${{ github.event_name == 'push' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
Expand Down
48 changes: 48 additions & 0 deletions website/.tx/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
[main]
host = https://www.transifex.com

[o:opengisch:p:signalo-website:r:documentation_desktop]
file_filter = documentation/desktop.<lang>.md
source_file = documentation/desktop.fr.md
source_lang = fr
type = GITHUBMARKDOWN

[o:opengisch:p:signalo-website:r:documentation_roadmap]
file_filter = documentation/roadmap.<lang>.md
source_file = documentation/roadmap.fr.md
source_lang = fr
type = GITHUBMARKDOWN

[o:opengisch:p:signalo-website:r:documentation_mobile]
file_filter = documentation/mobile.<lang>.md
source_file = documentation/mobile.fr.md
source_lang = fr
type = GITHUBMARKDOWN

[o:opengisch:p:signalo-website:r:documentation_installation]
file_filter = documentation/installation.<lang>.md
source_file = documentation/installation.fr.md
source_lang = fr
type = GITHUBMARKDOWN

[o:opengisch:p:signalo-website:r:documentation_home]
file_filter = documentation/index.<lang>.md
source_file = documentation/index.fr.md
source_lang = fr
type = GITHUBMARKDOWN

[o:opengisch:p:signalo-website:r:documentation_datamodel-doc]
file_filter = documentation/datamodel-doc.<lang>.md
source_file = documentation/datamodel-doc.fr.md
source_lang = fr
type = GITHUBMARKDOWN

[o:opengisch:p:signalo-website:r:documentation_data-model]
file_filter = documentation/data-model.<lang>.md
source_file = documentation/data-model.fr.md
source_lang = fr
type = GITHUBMARKDOWN

[o:opengisch:p:signalo-website:r:documentation_contribute]
file_filter = documentation/contribute.<lang>.md
source_file = documentation/contribute.fr.md
source_lang = fr
type = GITHUBMARKDOWN
38 changes: 22 additions & 16 deletions website/documentation/desktop.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,36 @@ hide:
### Ajout de signaux

* Mettre la couche "Support" en édition et digitaliser un point pour ouvrir le formulaire.
* Le formulaire et composé de trois onglets "Général", "Azimut" et "Photo"

<figure markdown>
![Projet QField](./assets/images/printscreen/support-form-general.png){ width="500"; loading=lazy }
<figcaption>Onglet général</figcaption>
</figure>
<figure markdown>
![Projet QField](./assets/images/printscreen/support-form-azimut.png){ width="500"; loading=lazy }
<figcaption>Onglet azimut</figcaption>
</figure>
<figure markdown>
![Projet QField](./assets/images/printscreen/support-form-photo.png){ width="500"; loading=lazy }
<figcaption>Onglet photo</figcaption>
</figure>
!!! info "Le formulaire et composé de trois onglets:"

=== "Général"
<figure markdown>
![Onglet général](./assets/images/printscreen/support-form-general.png){ width="500"; loading=lazy }
<figcaption>Onglet général</figcaption>
</figure>

=== "Azimut"
<figure markdown>
![Onglet azimut](./assets/images/printscreen/support-form-azimut.png){ width="500"; loading=lazy }
<figcaption>Onglet azimut</figcaption>
</figure>

=== "Photo"
<figure markdown>
![Onglet azimut](./assets/images/printscreen/support-form-photo.png){ width="500"; loading=lazy }
<figcaption>Onglet photo</figcaption>
</figure>

Dans l’onglet “Azimut”, les cadres et signaux peuvent y être saisis. L'attribut *Azimut* peut être rempli de manière graphique, grâce à la vue `vw_azimut_edit` du schéma `signalo_app`.

<figure markdown>
![Projet QField](./assets/images/printscreen/support-all.png){ width="500"; loading=lazy }
![Exemple](./assets/images/printscreen/support-all.png){ width="500"; loading=lazy }
<figcaption>Exemple d'un azimut avec plusieurs cadres et signaux</figcaption>
</figure>

<figure markdown>
![Projet QField](./assets/images/printscreen/azimut-edit.png){ width="500"; loading=lazy }
![Azimut](./assets/images/printscreen/azimut-edit.png){ width="500"; loading=lazy }
<figcaption>Définition de l'azimut de manière graphique, grâce à la vue vw_azimut_edit</figcaption>
</figure>

Expand All @@ -43,7 +49,7 @@ Dans l’onglet “Azimut”, les cadres et signaux peuvent y être saisis. L'at
La taille des panneaux peut être ajustée dans les propriétés du projet, dans l'onglet `Variables`, en modifiant la variable `signalo_img_size`.

<figure markdown>
![Projet QField](./assets/images/printscreen/set-image-size.png){ width="500"; loading=lazy }
![Réglage](./assets/images/printscreen/set-image-size.png){ width="500"; loading=lazy }
<figcaption>Réglage de la taille de l'image</figcaption>
</figure>

Expand Down
Binary file added website/documentation/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions website/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ copyright: Copyright &copy; 2022 <a href="https://OPENGIS.ch">OPENGIS.ch</a>
theme:
name: material
custom_dir: theme_overrides/
language: fr
features:
- navigation.tabs
- navigation.tabs.sticky
Expand Down Expand Up @@ -65,6 +66,11 @@ markdown_extensions:
- md_in_html
- fancyboxmd
- sane_lists
- admonition
- pymdownx.details
- pymdownx.tabbed:
alternate_style: true
- pymdownx.superfences

plugins:
- search
Expand Down
3 changes: 1 addition & 2 deletions website/requirements-insiders.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# mkdocs-material-8.5.4 (2022-09-30) at https://github.com/opengisch/mkdocs-material-insiders/commit/425df60910d649d80505851dc2fd3d240cd65e73
git+https://${GH_TOKEN_INSIDER}@github.com/opengisch/mkdocs-material-insiders@425df60910d649d80505851dc2fd3d240cd65e73#egg=mkdocs-material
git+https://${GH_TOKEN_INSIDER}@github.com/opengisch/[email protected]#egg=mkdocs-material
7 changes: 2 additions & 5 deletions website/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
mkdocs-material==8.5.4
mkdocs-video==1.3.0
mkdocs-material==9.5.9
mkdocs-video==1.5.0
mkdocs-static-i18n @ git+https://github.com/kamilkrzyskow/i18n.git@5de82f096531adfaf7990da89002fe6cb207ca7a
fancyboxmd==1.1.0
PyGithub==1.55
python-dotenv==0.19.2
python-frontmatter==1.0.0
21 changes: 16 additions & 5 deletions website/utils/transifex_utils.py → website/scripts/transifex_utils.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3

import glob
import os

import frontmatter
import re

TX_ORGANIZATION = "opengisch"
TX_PROJECT = "signalo-website"
Expand Down Expand Up @@ -30,10 +31,20 @@ def create_transifex_config():
# Get relative path of file
relative_path = os.path.relpath(file, start=root)

tx_slug = frontmatter.load(file).get("tx_slug", None)
tx_slugs = [re.match(r"^tx_slug: +(.*)", line) for line in open(file)]
tx_slugs = [t for t in tx_slugs if t]

if not tx_slugs:
print(f"No TX slug found for {relative_path}")

if tx_slug:
print(f"Found file with tx_slug defined: {relative_path}, {tx_slug}")
if len(tx_slugs) > 1:
print(f"More than 1 TX slug found for {relative_path}")

if tx_slugs:
tx_slug = tx_slugs[0].group(1)
print(
f"Found file with tx_slug defined: `{relative_path}`, `{tx_slug}`"
)
f.write(f"[o:{TX_ORGANIZATION}:p:{TX_PROJECT}:r:{tx_slug}]\n")
f.write(
f"file_filter = {''.join(relative_path.split('.')[:-2])}.<lang>.md\n"
Expand Down

0 comments on commit e7bd171

Please sign in to comment.