From 7337630704b195ac3771ebee1280d67061323c70 Mon Sep 17 00:00:00 2001 From: maximumG Date: Thu, 30 Sep 2021 09:21:38 +0200 Subject: [PATCH] chore: introduce the script_order notion in the documentation --- docs/customization/custom-scripts.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/customization/custom-scripts.md b/docs/customization/custom-scripts.md index 252e65f90..cf052f918 100644 --- a/docs/customization/custom-scripts.md +++ b/docs/customization/custom-scripts.md @@ -45,6 +45,20 @@ Defining script variables is optional: You may create a script with only a `run( Any output generated by the script during its execution will be displayed under the "output" tab in the UI. +By default, scripts within a module are ordered alphabetically in the scripts list page. To return scripts in a specific order, you can define the `script_order` variable at the end of your module. The `script_order` variable is a tuple which contains each Script class in the desired order. Any scripts that are omitted from this list will be listed last. + +```python +from extras.scripts import Script + +class MyCustomScript(Script): + ... + +class AnotherCustomScript(Script): + ... + +script_order = (MyCustomScript, AnotherCustomScript) +``` + ## Module Attributes ### `name`