From a9736adb886bb76cc79ce99b598e606efadcaa23 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 | 20 ++++++ README.md | 20 +++++- .../LC_MESSAGES/rougail_output_formatter.po | 62 +++++++++++++----- locale/rougail_output_formatter.pot | 37 ++++++++--- src/rougail/output_formatter/config.py | 31 ++++----- .../LC_MESSAGES/rougail_output_formatter.mo | Bin 735 -> 1599 bytes 6 files changed, 128 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..61a387f --- /dev/null +++ b/README.fr.md @@ -0,0 +1,20 @@ +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Reformater les fichiers de structure + +> [!NOTE] +> +> Le fichier de structure sera formaté en respectant un ensemble de règles : 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..cdb638d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ -# rougail-output-formatter +--- +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, short-hand 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..cd41137 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:52+0100\n" +"PO-Revision-Date: 2025-12-24 09:52+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, short-hand notation whenever possible, attribute " +"order, re-indentation (especially for Jinja2 templates), ..." +msgstr "" +"Le fichier de structure sera formaté en respectant un ensemble de règles : " +"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..38ee82d 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:52+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, short-hand 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..fa9b42b 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,16 +46,20 @@ 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, short-hand 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')} """ return { "name": "formatter", 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..9159e9f689b45d18a375618a609881d22407c029 100644 GIT binary patch literal 1599 zcma)5&5jc}5H<_DKqREyy&-WZjX(ozx;F`o7=pO)E6|LXMOlQz$?2{n9(CJ|?amMo zM;?JIXXXjGa0@TM3+!pRAp{SA#OLlzk`W+isq)EARee?E`u_X#&~t&W0XqT9V8>vu zVd47-TZ4Uq{Q+A&Q2Sj3zQy?-@Fei`FEHRHa1}TPo&vrAo&mlAeg=L3-UhxuD8zB# zg+q1xKfwQS9s`5_gI|Sc1D^pS;49!+;5%Rp{QWl}KrN7F{^2ii1QvS1-vU$u>BLc3 z_zs7kl_#yIE2JE0<4Mw3W-6tD%D74W(v#8I1lQprILRzCJDiG5`AFquPMOk7PCaIE zmj}k?(vu(I#@jOSrR6HniQZRtw4<_&`f#YCJf|d+#Mo5nA$bEz$6z0jEi-mq;=J&a zny$}&hglQLWQ2OHlKoJv8yV}P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