Skip to content

Commit

Permalink
Removing mandatory (#102)
Browse files Browse the repository at this point in the history
* suppressing mandatory attribute
* fixing help
* regenerating docs
  • Loading branch information
procrastinatio authored Nov 7, 2024
1 parent 757b50d commit 4b22bef
Show file tree
Hide file tree
Showing 10 changed files with 4,142 additions and 2,706 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ PANDOC_ODT_OPTIONS=
# Help target
help:
@echo "Usage:"
@echo " make all - Generate all files (PDF, DOCX, HTML and ODT for all languages)"
@echo " make pdf - Generate only PDF files for all languages"
@echo " make docx - Generate only PDF files for all languages"
@echo " make all - Generate all files (PDF, DOCX, HTML and ODT for all languages)"
@echo " make pdfs - Generate only PDF files for all languages"
@echo " make docxs - Generate only DOCX files for all languages"
@echo " make odts - Generate only ODT files for all languages"
@echo " make htmls - Generate only HTML files for all languages"
@echo " make mds - Generate only Markdown files for all languages"
@echo " make de - Generate all files (PDF, DOCX, HTML and ODT) for German"
@echo " make fr - Generate all files (PDF, DOCX, HTML and ODT) for French"
@echo " make babel - Generate .mo translation files"
Expand Down
1,594 changes: 1,035 additions & 559 deletions inputs/de/datamodel.json

Large diffs are not rendered by default.

1,834 changes: 1,034 additions & 800 deletions inputs/de/datamodel.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inputs/de/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Datenmodell Geologie, Revision 3.9.1 (a4e61c5)
title: Datenmodell Geologie, Revision 3.9.10 (757b50d)
subtitle: Beschreibung und Datenkatalog
author: Bundesamt für Landestopographie swisstopo
date: September 2024
date: November 2024
keywords:
- "GeoCover"
- "Metadata"
Expand Down
1,594 changes: 1,035 additions & 559 deletions inputs/fr/datamodel.json

Large diffs are not rendered by default.

1,799 changes: 1,023 additions & 776 deletions inputs/fr/datamodel.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inputs/fr/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Modèle de donnée géologique, Révision 3.9.1 (a4e61c5)
title: Modèle de donnée géologique, Révision 3.9.10 (757b50d)
subtitle: Description et catalogue de donnée
author: Office fédéral de topographie swisstopo
date: septembre 2024
date: novembre 2024
keywords:
- "GeoCover"
- "Metadata"
Expand Down
Binary file modified outputs/de/datamodel.pdf
Binary file not shown.
Binary file modified outputs/fr/datamodel.pdf
Binary file not shown.
10 changes: 5 additions & 5 deletions templates/model_markdown.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@



{{_("Name")}} | {{_("Type")}} | {{_("Description")}} | {{_("Mandat.")}} | {{_("Card.")}}
-------------------------|----------|---------------------------------------------------|-----|-----
{{_("Name")}} | {{_("Type")}} | {{_("Description")}} | {{_("Card.")}}
--------------------------|------------|-----------------------------------------------------|-----
{% for attr in cls.attributes -%}
{%- if attr.change != 'removed' -%}
{%- if attr.mandatory -%}{% set mandatory = "**%s**" % (_("yes")) -%}{% else -%}{% set mandatory = "%s" % (_("no")) -%}{% endif -%}
{%- if attr.att_type == 'CD' -%}{% set slug = "%s-%s" % (cls.name, attr.name) -%}
{%- elif attr.att_type == 'annex' -%}{% set slug, location = attr.value, 'vgl. Anhang %s' % attr.value %}{% set see_annex = 'Die möglichen Werte sind in der Tabelle %s im Anhang dieses Dokumentes verfügbar.' % attr.value %}{%- else -%}{% set slug = None %}{% endif -%}
{%- if (slug != None) and (attr.att_type == 'CD') -%}
**{{ attr.name |upper }}** | [{{_("CodedDomain")}}](#{{slug| slugify}}) | {{ attr.description[lang]|trim }}.| {{mandatory}} | [{{ attr.cardinality}}]
**{{ attr.name |upper }}** | [{{_("CodedDomain")}}](#{{slug| slugify}}) | {{ attr.description[lang]|trim }}. | [{{ attr.cardinality}}]
{%elif (slug != None) and (attr.att_type == 'annex') -%}
**{{ attr.name |upper }}** | [ {{_("Table")}} ](#{{slug| slugify}}) | {{ attr.description[lang]|trim }}.| {{mandatory}} | [{{ attr.cardinality}}]
**{{ attr.name |upper }}** | [ {{_("Table")}} ](#{{slug| slugify}}) | {{ attr.description[lang]|trim }}. | [{{ attr.cardinality}}]
{% else -%}
**{{ attr.name |upper }}** | {{attr.att_type}} | {{ attr.description[lang]|trim }} |{{mandatory}} | [{{ attr.cardinality}}]
**{{ attr.name |upper }}** | {{attr.att_type}} | {{ attr.description[lang]|trim }} | [{{ attr.cardinality}}]
{% endif -%}
{% endif -%}
{% endfor %}
Expand Down

0 comments on commit 4b22bef

Please sign in to comment.