From 3a25db1247cdd37b216a6a095d1999ded383f901 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 28 May 2021 20:30:28 -0400 Subject: [PATCH] docs: Move description of menu templates to Command_Templates.md Signed-off-by: Kevin O'Connor --- docs/Command_Templates.md | 24 ++++++++++++++++++++++++ docs/Config_Reference.md | 22 +++------------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/docs/Command_Templates.md b/docs/Command_Templates.md index f27f4a65..d9533f29 100644 --- a/docs/Command_Templates.md +++ b/docs/Command_Templates.md @@ -279,6 +279,30 @@ gcode: UPDATE_DELAYED_GCODE ID=report_temp DURATION=0 ``` +### Menu templates + +If a [display config section](Config_Reference.md#display) is enabled, +then it is possible to customize the menu with +[menu](Config_Reference.md#menu) config sections. + +The following read-only attributes are available in menu templates: +* `menu.width` - element width (number of display columns) +* `menu.ns` - element namespace +* `menu.event` - name of the event that triggered the script +* `menu.input` - input value, only available in input script context + +The following actions are available in menu templates: +* `menu.back(force, update)`: will execute menu back command, optional + boolean parameters `` and ``. + * When `` is set True then it will also stop editing. Default + value is False. + * When `` is set False then parent container items are not + updated. Default value is True. +* `menu.exit(force)` - will execute menu exit command, optional + boolean parameter `` default value False. + * When `` is set True then it will also stop editing. Default + value is False. + ### Save Variables to disk diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index f09b90a9..ba5d828a 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -3533,25 +3533,9 @@ A [default set of menus](../klippy/extras/display/menu.cfg) are automatically created. One can replace or extend the menu by overriding the defaults in the main printer.cfg config file. -Available options in menu Jinja2 template context: - -Read-only attributes for menu element: -* menu.width - element width (number of display columns) -* menu.ns - element namespace -* menu.event - name of the event that triggered the script -* menu.input - input value, only available in input script context - -List of actions for menu element: -* menu.back(force, update): will execute menu back command, optional - boolean parameters and . - * When is set True then it will also stop editing. Default - value is False - * When is set False then parent container items are not - updated. Default value is True -* menu.exit(force) - will execute menu exit command, optional boolean - parameter default value False - * When is set True then it will also stop editing. Default - value is False +See the [command template +document](Command_Templates.md#menu-templates) for information on menu +attributes available during template rendering. ``` # Common parameters available for all menu config sections.