doc: fix page routes and inconsistencies

This commit is contained in:
axolotle 2023-10-23 16:18:44 +02:00
parent b3167ba2e8
commit d676348d35
4 changed files with 16 additions and 19 deletions

View file

@ -29,10 +29,10 @@ template: docs
taxonomy: taxonomy:
category: docs category: docs
routes: routes:
default: '/packaging_apps_config_panels' default: '/packaging_config_panels'
--- ---
# Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/{current_commit}/doc/generate_configpanel_doc.py) on {today} (YunoHost version {version}) Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/{current_commit}/doc/generate_configpanel_doc.py) on {today} (YunoHost version {version})
## Glossary ## Glossary
@ -52,7 +52,7 @@ You may encounter some named types which are used for simplicity.
``` ```
- `JSExpression`: a `str` JS expression to be evaluated to `true` or `false`: - `JSExpression`: a `str` JS expression to be evaluated to `true` or `false`:
- used for properties: `visible` and `enabled` - used for properties: `visible` and `enabled`
- operators availables: `==`, `!=`, `!`, `&&`, `||`, `+`, `-`, `*`, `/`, `%`, `match()` - operators availables: `==`, `!=`, `>`, `>=`, `<`, `<=`, `!`, `&&`, `||`, `+`, `-`, `*`, `/`, `%` and `match()`
- [examples available in the advanced section of Options](/packaging_apps_options#advanced-use-cases) - [examples available in the advanced section of Options](/packaging_apps_options#advanced-use-cases)
""" """
) )

View file

@ -29,10 +29,10 @@ template: docs
taxonomy: taxonomy:
category: docs category: docs
routes: routes:
default: '/packaging_apps_options' default: '/dev/forms'
--- ---
# Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/{current_commit}/doc/generate_options_doc.py) on {today} (YunoHost version {version}) Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/{current_commit}/doc/generate_options_doc.py) on {today} (YunoHost version {version})
## Glossary ## Glossary
@ -52,7 +52,7 @@ You may encounter some named types which are used for simplicity.
``` ```
- `JSExpression`: a `str` JS expression to be evaluated to `true` or `false`: - `JSExpression`: a `str` JS expression to be evaluated to `true` or `false`:
- used for properties: `visible` and `enabled` - used for properties: `visible` and `enabled`
- operators availables: `==`, `!=`, `!`, `&&`, `||`, `+`, `-`, `*`, `/`, `%`, `match()` - operators availables: `==`, `!=`, `>`, `>=`, `<`, `<=`, `!`, `&&`, `||`, `+`, `-`, `*`, `/`, `%` and `match()`
- [examples available in the advanced section](#advanced-use-cases) - [examples available in the advanced section](#advanced-use-cases)
- `Binding`: bind a value to a file/property/variable/getter/setter/validator - `Binding`: bind a value to a file/property/variable/getter/setter/validator
- save the value in `settings.yaml` when not defined - save the value in `settings.yaml` when not defined
@ -63,13 +63,13 @@ You may encounter some named types which are used for simplicity.
- [examples available in the advanced section](#bind) - [examples available in the advanced section](#bind)
- `Pattern`: a `dict` with a regex to match the value against and an error message - `Pattern`: a `dict` with a regex to match the value against and an error message
```toml ```toml
pattern.regexp = "^[A-F]\d\d$" pattern.regexp = '^[A-F]\d\d$'
pattern.error = "Provide a room like F12: one uppercase and 2 numbers" pattern.error = "Provide a room like F12: one uppercase and 2 numbers"
# or with translated error # or with translated error
pattern.error.en = "Provide a room like F12: one uppercase and 2 numbers" pattern.error.en = "Provide a room like F12: one uppercase and 2 numbers"
pattern.error.fr = "Entrez un numéro de salle comme F12: une lettre majuscule et deux chiffres." pattern.error.fr = "Entrez un numéro de salle comme F12: une lettre majuscule et deux chiffres."
``` ```
- IMPORTANT: your pattern should be between simple quote, not double. - IMPORTANT: your `pattern.regexp` should be between simple quote, not double.
""" """
) )

View file

@ -215,19 +215,16 @@ class PanelModel(ContainerModel):
class ConfigPanelModel(BaseModel): class ConfigPanelModel(BaseModel):
""" """
Config panels are descriptive format in TOML to bind settings to form items so that a user can alter some of the app's configuration without manually editing files from the command line. Configuration panels are descriptive format in TOML to bind settings to form items so that a user can alter some of the app's configuration without manually editing files from the command line.
From a packager perspective, this configpanel.toml is coupled to the `scripts/config` script, which may be used to define custom getters/setters. However, most use cases should be covered automagically by the core, thus it may not be necessary to define a scripts/config at all! From a packager perspective, this `config_panel.toml` is coupled to the `scripts/config` script, which may be used to define custom getters/setters. However, most use cases should be covered automagically by the core, thus it may not be necessary to define a scripts/config at all!
---------------- ! IMPORTANT: Please: Keep in mind the YunoHost spirit, and try to build your panels in such a way as to expose only really useful parameters, and if there are many of them, to relegate those corresponding to rarer use cases to "Advanced" sub-sections.
IMPORTANT: In accordance with YunoHost's spirit, please keep things simple and do not overwhelm the admin with tons of misunderstandable or advanced settings.
----------------
Config panels are structured as a series of panels (that renders as tabs in the web-admin) that contains a series of sections that contains options. Config panels are structured as a series of panels (that renders as tabs in the web-admin) that contains a series of sections that contains options.
Options can be directly binded to settings, or captured by custom bash setters/getter, `button` Options can trigger custom bash functions. Options can be directly binded to settings, or captured by custom bash setters/getter, `button` Options can trigger "actions" (e.g. custom bash functions).
- [Learn more about Options](/packaging_apps_options) in their dedicated doc page as those are also used in app install forms. - [Learn more about Options](/dev/forms) in their dedicated doc page as those are also used in app install forms.
- [Check the basic toml example](https://github.com/YunoHost/example_ynh/blob/master/config_panel.toml.example) and the [basic `scripts/config` example](https://github.com/YunoHost/example_ynh/blob/master/scripts/config) - [Check the basic toml example](https://github.com/YunoHost/example_ynh/blob/master/config_panel.toml.example) and the [basic `scripts/config` example](https://github.com/YunoHost/example_ynh/blob/master/scripts/config)
- [Check config panels of other apps](https://grep.app/search?q=version&filter[repo.pattern][0]=YunoHost-Apps&filter[lang][0]=TOML) - [Check config panels of other apps](https://grep.app/search?q=version&filter[repo.pattern][0]=YunoHost-Apps&filter[lang][0]=TOML)
- [Check `scripts/config` of other apps](https://grep.app/search?q=ynh_app_config_apply&filter[repo.pattern][0]=YunoHost-Apps&filter[lang][0]=Shell) - [Check `scripts/config` of other apps](https://grep.app/search?q=ynh_app_config_apply&filter[repo.pattern][0]=YunoHost-Apps&filter[lang][0]=Shell)

View file

@ -553,8 +553,8 @@ class ButtonOption(BaseReadonlyOption):
- [common properties](#common-option-properties) - [common properties](#common-option-properties)
- `bind`: forced to `"null"` - `bind`: forced to `"null"`
- `style`: any of `"success|info|warning|danger"` (default: `"success"`) - `style`: any of `"success|info|warning|danger"` (default: `"success"`)
- `enabled`: `Binding` or `bool` (default: `true`) - `enabled`: `JSExpression` or `bool` (default: `true`)
- when used with `Binding` you can enable/disable the button depending on context - when used with `JSExpression` you can enable/disable the button depending on context
- `icon` (optional): any icon name from [Fork Awesome](https://forkaweso.me/Fork-Awesome/icons/) - `icon` (optional): any icon name from [Fork Awesome](https://forkaweso.me/Fork-Awesome/icons/)
- Currently only displayed in the web-admin - Currently only displayed in the web-admin
""" """
@ -764,7 +764,7 @@ class StringOption(BaseStringOption):
[section.my_option_id] [section.my_option_id]
type = "string" type = "string"
default = "E10" default = "E10"
pattern.regexp = "^[A-F]\d\d$" pattern.regexp = '^[A-F]\d\d$'
pattern.error = "Provide a room like F12 : one uppercase and 2 numbers" pattern.error = "Provide a room like F12 : one uppercase and 2 numbers"
``` ```