From 7695b512c07ed01502e824395edd6658d47c8966 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 24 Dec 2025 09:50:07 +0100 Subject: [PATCH] feat: add doc --- README.fr.md | 131 ++++++++++++++++++ README.md | 131 +++++++++++++++++- .../LC_MESSAGES/rougail_output_formatter.po | 62 ++++++--- locale/rougail_output_formatter.pot | 37 +++-- src/rougail/output_formatter/config.py | 32 +++-- .../LC_MESSAGES/rougail_output_formatter.mo | Bin 735 -> 1597 bytes 6 files changed, 351 insertions(+), 42 deletions(-) create mode 100644 README.fr.md diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 0000000..3c625b7 --- /dev/null +++ b/README.fr.md @@ -0,0 +1,131 @@ + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: si formatter n'est pas dans "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + +formatter: + description: Reformater les fichiers de structure + help: |- + Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: si formatter n'est pas défini dans "step.output" + + line_width: 120 # Taille maximum des lignes + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: si formatter n'est pas dans "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + +formatter: + description: Reformater les fichiers de structure + help: |- + Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: si formatter n'est pas défini dans "step.output" + + line_width: 120 # Taille maximum des lignes + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: si formatter n'est pas dans "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + +formatter: + description: Reformater les fichiers de structure + help: |- + Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: si formatter n'est pas défini dans "step.output" + + line_width: 120 # Taille maximum des lignes + +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Reformater les fichiers de structure + +> [!NOTE] +> +> Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ...\ +> **Chemin** : formatter\ +> *`désactivé`*\ +> **Désactivé** : si formatter n'est pas défini dans "[Sélection pour sortie](#step.output)" + +| Variable | Description | Valeur par défaut | Type | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|---------------------|---------------------------------------------------------------------------------------------------| +| **formatter.line_width**
**Ligne de commande** :
--formatter.line_width
**Variable d'environnement** : FORMATTER.LINE_WIDTH | Taille maximum des lignes. | 120 | [`integer`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | + + diff --git a/README.md b/README.md index 136af25..ec49a63 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,131 @@ -# rougail-output-formatter + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: true if formatter is not in "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: if formatter is not in "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: true if formatter is not in "step.output" + +formatter: + description: Reformat the structure files + help: |- + The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: if formatter is not set in "step.output" + + line_width: 120 # Maximum line size + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: true if formatter is not in "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: if formatter is not in "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: true if formatter is not in "step.output" + +formatter: + description: Reformat the structure files + help: |- + The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: if formatter is not set in "step.output" + + line_width: 120 # Maximum line size + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: true if formatter is not in "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: if formatter is not in "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: true if formatter is not in "step.output" + +formatter: + description: Reformat the structure files + help: |- + The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: if formatter is not set in "step.output" + + line_width: 120 # Maximum line size + +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Reformat the structure files + +> [!NOTE] +> +> The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ...\ +> **Path**: formatter\ +> *`disabled`*\ +> **Disabled**: if formatter is not set in "[Select for output](#step.output)" + +| Variable | Description | Default value | Type | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|-----------------|-------------------------------------------------------------------------------------------------| +| **formatter.line_width**
**Command line**:
--formatter.line_width
**Environment variable**: FORMATTER.LINE_WIDTH | Maximum line size. | 120 | [`integer`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | + diff --git a/locale/fr/LC_MESSAGES/rougail_output_formatter.po b/locale/fr/LC_MESSAGES/rougail_output_formatter.po index edc5e50..f38d18e 100644 --- a/locale/fr/LC_MESSAGES/rougail_output_formatter.po +++ b/locale/fr/LC_MESSAGES/rougail_output_formatter.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-09-29 11:38+0200\n" -"PO-Revision-Date: 2025-09-29 11:46+0200\n" +"POT-Creation-Date: 2025-12-24 09:47+0100\n" +"PO-Revision-Date: 2025-12-24 09:49+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -14,24 +14,54 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: pygettext.py 1.5\n" -"X-Generator: Poedit 3.7\n" +"X-Generator: Poedit 3.8\n" -#: src/rougail/output_formatter/__init__.py:105 +#: src/rougail/output_formatter/__init__.py:119 msgid "the \"step.output\" is not set to \"{0}\"" msgstr "\"step.output\" n'est pas défini pour \"{0}\"" -#: src/rougail/output_formatter/__init__.py:155 -msgid "only one file is allowed" -msgstr "seulement un fichier est autorisé" +#: src/rougail/output_formatter/__init__.py:167 +msgid "only one filename is allowed, not \"{0}\"" +msgstr "seulement un fichier est autorisé, pas \"{0}\"" -#: src/rougail/output_formatter/__init__.py:158 -msgid "only a file is allowed" -msgstr "seulement un fichier est autorisé" +#: src/rougail/output_formatter/__init__.py:170 +msgid "\"{0}\" is not a valid file, but only a file is allowed" +msgstr "" +"\"{0}\" n'est pas un fichier valide, mais seulement un fichier est autorisé" -#: src/rougail/output_formatter/config.py:59 -msgid "Configuration for rougail-ouput-formatter" -msgstr "Configuration pour rougail-ouput-formatter" +#: src/rougail/output_formatter/config.py:34 +#: src/rougail/output_formatter/config.py:50 +msgid "true if formatter is not in \"step.output\"" +msgstr "trus si formatter n'est pas dans \"step.output\"" -#: src/rougail/output_formatter/config.py:61 -msgid "Line size" -msgstr "Taille des lignes" +#: src/rougail/output_formatter/config.py:39 +msgid "if formatter is not in \"step.output\"" +msgstr "si formatter n'est pas dans \"step.output\"" + +#: src/rougail/output_formatter/config.py:53 +msgid "Reformat the structure files" +msgstr "Reformater les fichiers de structure" + +#: src/rougail/output_formatter/config.py:55 +msgid "" +"The structure file will be formatted according to a set of rules: empty line " +"between each variable, condensed notation whenever possible, attribute " +"order, re-indentation (especially for Jinja2 templates), ..." +msgstr "" +"Le fichier de structure sera formater en respectant un ensemble de règle : " +"ligne vide entre chaque variable, notation condensée dès que possible, ordre " +"des attributs, réindentation (notamment pour les templates Jinja2), ..." + +#: src/rougail/output_formatter/config.py:60 +msgid "if formatter is not set in \"step.output\"" +msgstr "si formatter n'est pas défini dans \"step.output\"" + +#: src/rougail/output_formatter/config.py:62 +msgid "Maximum line size" +msgstr "Taille maximum des lignes" + +#~ msgid "only a file is allowed" +#~ msgstr "seulement un fichier est autorisé" + +#~ msgid "Configuration for rougail-ouput-formatter" +#~ msgstr "Configuration pour rougail-ouput-formatter" diff --git a/locale/rougail_output_formatter.pot b/locale/rougail_output_formatter.pot index c4f6f76..11360ed 100644 --- a/locale/rougail_output_formatter.pot +++ b/locale/rougail_output_formatter.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-09-29 11:47+0200\n" +"POT-Creation-Date: 2025-12-24 09:49+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,23 +15,40 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: src/rougail/output_formatter/__init__.py:105 +#: src/rougail/output_formatter/__init__.py:119 msgid "the \"step.output\" is not set to \"{0}\"" msgstr "" -#: src/rougail/output_formatter/__init__.py:155 -msgid "only one file is allowed" +#: src/rougail/output_formatter/__init__.py:167 +msgid "only one filename is allowed, not \"{0}\"" msgstr "" -#: src/rougail/output_formatter/__init__.py:158 -msgid "only a file is allowed" +#: src/rougail/output_formatter/__init__.py:170 +msgid "\"{0}\" is not a valid file, but only a file is allowed" msgstr "" -#: src/rougail/output_formatter/config.py:59 -msgid "Configuration for rougail-ouput-formatter" +#: src/rougail/output_formatter/config.py:34 +#: src/rougail/output_formatter/config.py:50 +msgid "true if formatter is not in \"step.output\"" msgstr "" -#: src/rougail/output_formatter/config.py:61 -msgid "Line size" +#: src/rougail/output_formatter/config.py:39 +msgid "if formatter is not in \"step.output\"" +msgstr "" + +#: src/rougail/output_formatter/config.py:53 +msgid "Reformat the structure files" +msgstr "" + +#: src/rougail/output_formatter/config.py:55 +msgid "The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ..." +msgstr "" + +#: src/rougail/output_formatter/config.py:60 +msgid "if formatter is not set in \"step.output\"" +msgstr "" + +#: src/rougail/output_formatter/config.py:62 +msgid "Maximum line size" msgstr "" diff --git a/src/rougail/output_formatter/config.py b/src/rougail/output_formatter/config.py index bdeb356..c829f33 100644 --- a/src/rougail/output_formatter/config.py +++ b/src/rougail/output_formatter/config.py @@ -30,16 +30,13 @@ load_unexist_redefine: type: boolean default: jinja: >- - {{% if step.output is not propertyerror and step.output == 'formatter' %}} - true - {{% else %}} - false - {{% endif %}} + {{{{ step.output is not propertyerror and step.output == 'formatter' }}}} + description: {_('true if formatter is not in "step.output"')} hidden: jinja: >- - {{% if step.output is not propertyerror and step.output == 'formatter' %}} - load_unexist_redefine is always true with 'formatter' output - {{% endif %}} + {{{{ step.output is not propertyerror and step.output == 'formatter' }}}} + return_type: boolean + description: {_('if formatter is not in "step.output"')} cli: @@ -49,17 +46,22 @@ cli: type: boolean default: jinja: >- - {{% if step.output is not propertyerror and step.output == 'formatter' %}} - false - {{% else %}} - true - {{% endif %}} + {{{{ step.output is propertyerror or step.output != 'formatter' }}}} + description: {_('true if formatter is not in "step.output"')} formatter: - description: {_('Configuration for rougail-ouput-formatter')} + description: {_('Reformat the structure files')} + help: |- + {_('The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ...')} + disabled: + jinja: >- + {{{{ step.output is propertyerror or step.output != 'formatter' }}}} + return_type: boolean + description: {_('if formatter is not set in "step.output"')} - line_width: 120 # {_('Line size')} + line_width: 120 # {_('Maximum line size')} """ + print(options) return { "name": "formatter", "process": "output", diff --git a/src/rougail/output_formatter/locale/fr/LC_MESSAGES/rougail_output_formatter.mo b/src/rougail/output_formatter/locale/fr/LC_MESSAGES/rougail_output_formatter.mo index 67ad2f42631b9c3022cf89a436df83b166806290..dfd94d111964bd0c754d164a28723a5d3a354148 100644 GIT binary patch literal 1597 zcma)5OO6vs5X}LGk0nN$*&(qAwLs0sRbv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