From c37f87d05b216215238a340ae58282ab3505f564 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 23 Dec 2025 21:38:51 +0100 Subject: [PATCH] feat: add doc --- README.fr.md | 20 +++++++++++ README.md | 20 ++++++++++- locale/fr/LC_MESSAGES/rougail_output_json.po | 31 ++++++++++++------ locale/rougail_output_json.pot | 22 +++++++++---- src/rougail/output_json/config.py | 17 ++++------ .../fr/LC_MESSAGES/rougail_output_json.mo | Bin 1119 -> 1331 bytes 6 files changed, 82 insertions(+), 28 deletions(-) create mode 100644 README.fr.md diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 0000000..66528d1 --- /dev/null +++ b/README.fr.md @@ -0,0 +1,20 @@ +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Export de la configuration au format JSON + +> [!NOTE] +> +> **Chemin** : json\ +> *`désactivé`*\ +> **Désactivé** : si json n'est pas présent dans "[Sélection pour sortie](#step.output)" + +| Variable | Description | Valeur par défaut | Type | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| +| **json.mandatory**
**Ligne de commande** :
• --json.mandatory
• --json.no-mandatory
**Variable d'environnement** : JSON.MANDATORY | Tester les variables obligatoires avant de l'afficher en json. | true si "[La configuration dans l'état de sortie est dans mode lecture-écriture](#cli.read_write)" est false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | +| **json.get**
**Ligne de commande** :
--json.get
**Variable d'environnement** : JSON.GET | Récupère la valeur pour une variable ou une famille. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | + + diff --git a/README.md b/README.md index a3a5004..56bbb8f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ -# rougail-output-json +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Export configuration to JSON format + +> [!NOTE] +> +> **Path**: json\ +> *`disabled`*\ +> **Disabled**: if json is not set in "[Select for output](#step.output)" + +| Variable | Description | Default value | Type | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------| +| **json.mandatory**
**Command line**:
• --json.mandatory
• --json.no-mandatory
**Environment variable**: JSON.MANDATORY | Test mandatories variables before display in json. | true if "[Configuration in output step is in read_write mode](#cli.read_write)" is false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | +| **json.get**
**Command line**:
--json.get
**Environment variable**: JSON.GET | Get value for a variable or a family. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | + diff --git a/locale/fr/LC_MESSAGES/rougail_output_json.po b/locale/fr/LC_MESSAGES/rougail_output_json.po index a540148..8dcfddc 100644 --- a/locale/fr/LC_MESSAGES/rougail_output_json.po +++ b/locale/fr/LC_MESSAGES/rougail_output_json.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-10-05 21:25+0200\n" -"PO-Revision-Date: 2025-10-05 21:26+0200\n" +"POT-Creation-Date: 2025-12-24 09:19+0100\n" +"PO-Revision-Date: 2025-12-24 09:20+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -14,36 +14,47 @@ 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_json/__init__.py:48 +#: src/rougail/output_json/__init__.py:50 msgid "the \"step.output\" is not set to \"{0}\"" msgstr "\"step.output\" n'est pas mis à \"{0}\"" -#: src/rougail/output_json/__init__.py:105 +#: src/rougail/output_json/__init__.py:111 msgid "Error in config: {0}" msgstr "Erreur dans la configuration : {0}" -#: src/rougail/output_json/__init__.py:115 +#: src/rougail/output_json/__init__.py:121 msgid "The following variables are mandatory but have no value:" msgstr "Les variables suivantes sont obligatoire mais n'ont pas de valeur :" -#: src/rougail/output_json/__init__.py:125 +#: src/rougail/output_json/__init__.py:131 msgid "The following variables are inaccessible but are empty and mandatory :" msgstr "Les variables suivantes sont inaccessibles mais sont vides et obligatoires :" #: src/rougail/output_json/config.py:29 -msgid "configuration rougail-json" -msgstr "configuration de rougail-json" +msgid "Export configuration to JSON format" +msgstr "Export de la configuration au format JSON" + +#: src/rougail/output_json/config.py:34 +msgid "if json is not set in \"step.output\"" +msgstr "si json n'est pas présent dans \"step.output\"" #: src/rougail/output_json/config.py:37 msgid "test mandatories variables before display in json" msgstr "tester les variables obligatoires avant de l'afficher en json" -#: src/rougail/output_json/config.py:48 +#: src/rougail/output_json/config.py:42 +msgid "true if \"cli.read_write\" is false" +msgstr "true si \"cli.read_write\" est false" + +#: src/rougail/output_json/config.py:45 msgid "get value for a variable or a family" msgstr "récupère la valeur pour une variable ou une famille" +#~ msgid "configuration rougail-json" +#~ msgstr "configuration de rougail-json" + #~ msgid "display variables available in read_write mode" #~ msgstr "affiche les variables valables en mode lecture écriture" diff --git a/locale/rougail_output_json.pot b/locale/rougail_output_json.pot index 94a7131..ad54467 100644 --- a/locale/rougail_output_json.pot +++ b/locale/rougail_output_json.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-10-05 21:26+0200\n" +"POT-Creation-Date: 2025-12-24 09:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,31 +15,39 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: src/rougail/output_json/__init__.py:48 +#: src/rougail/output_json/__init__.py:50 msgid "the \"step.output\" is not set to \"{0}\"" msgstr "" -#: src/rougail/output_json/__init__.py:105 +#: src/rougail/output_json/__init__.py:111 msgid "Error in config: {0}" msgstr "" -#: src/rougail/output_json/__init__.py:115 +#: src/rougail/output_json/__init__.py:121 msgid "The following variables are mandatory but have no value:" msgstr "" -#: src/rougail/output_json/__init__.py:125 +#: src/rougail/output_json/__init__.py:131 msgid "The following variables are inaccessible but are empty and mandatory :" msgstr "" #: src/rougail/output_json/config.py:29 -msgid "configuration rougail-json" +msgid "Export configuration to JSON format" +msgstr "" + +#: src/rougail/output_json/config.py:34 +msgid "if json is not set in \"step.output\"" msgstr "" #: src/rougail/output_json/config.py:37 msgid "test mandatories variables before display in json" msgstr "" -#: src/rougail/output_json/config.py:48 +#: src/rougail/output_json/config.py:42 +msgid "true if \"cli.read_write\" is false" +msgstr "" + +#: src/rougail/output_json/config.py:45 msgid "get value for a variable or a family" msgstr "" diff --git a/src/rougail/output_json/config.py b/src/rougail/output_json/config.py index 281461d..5e2d6f8 100644 --- a/src/rougail/output_json/config.py +++ b/src/rougail/output_json/config.py @@ -26,23 +26,20 @@ def get_rougail_config( ) -> dict: options = f""" json: - description: {_('configuration rougail-json')} + description: {_('Export configuration to JSON format')} disabled: - jinja: | - {{% if step.output is propertyerror or step.output != 'json' %}} - disabled - {{% endif %}} + jinja: |- + {{{{ step.output is propertyerror or step.output != 'json' }}}} + return_type: boolean + description: {_('if json is not set in "step.output"')} mandatory: description: {_('test mandatories variables before display in json')} type: boolean default: jinja: |- - {{% if cli.read_write is defined and cli.read_write %}} - false - {{% else %}} - true - {{% endif %}} + {{{{ cli.read_write is not defined or not cli.read_write }}}} + description: {_('true if "cli.read_write" is false')} get: description: {_('get value for a variable or a family')} diff --git a/src/rougail/output_json/locale/fr/LC_MESSAGES/rougail_output_json.mo b/src/rougail/output_json/locale/fr/LC_MESSAGES/rougail_output_json.mo index bdd869075e005dde3a9a89dd2a37ba7b68988221..4ec5d19f783f437e2d43eec25b2efcf18b576a80 100644 GIT binary patch delta 549 zcmZXPyGjE=6o$_xUZNm~h?T`;lSNb#)}RstRuaJrT3A`hVkR;gch{L&R78R=An0Q0 z11MP8SlEbQ>l3ICVB-ZV5&UPh(gPpgFf-@OKTny<&gNrJ%L$=6K|g4KE^rM@y?|cu z3UZ*$BASMW;4-`g=izhMoZrJE@H_0lPKqcC&%s~tCTznSX`(@*CLLlikBuvM3T|y7 z8iQxx0^Ecr;R`qqKf`7~cPkOzpf+I2e4ry)5#bHOxTJ86+5y@qV|J=i29gP%tpl&X%ULZW&T!dYZHS`eUTtMt3e9cPSoa!=#~)U)t5hhBGIyd-*T&OkZ^NXvqZTmfX50tJo% zX