From 11cebe8c110fcfe8a537350ce6ad2abddb391b5c Mon Sep 17 00:00:00 2001 From: alfrix Date: Sun, 7 Apr 2024 08:47:43 -0300 Subject: [PATCH] docs: update menu close #1322 --- docs/Configuration.md | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 50388613..420fd539 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -156,9 +156,10 @@ A menu item is configured as follows: ```{ .ini .no-copy } [menu __main my_menu_item] name: Item Name -# To build a sub-menu of this menu item, you would next use [menu __main my_menu_item sub_menu_item] +# To build a sub-menu of this menu item, you would next define [menu __main my_menu_item sub_menu_item] +# +# --- The following items are optional --- # -# The following items are optional: # icon: home # Icon name to be used, it can be any image in the directory: # KlipperScreen/styles/{theme}/images/ where {theme} is your current theme @@ -166,19 +167,33 @@ name: Item Name # # style: mycolor4 # Icon style, defined as "button.mycolor4" (for example) in the theme css +# # panel: preheat # Panel from the panels folder in the KlipperScreen folder -# method: printer.gcode.script -# Moonraker method to call when the item is selected -# params: {"script":"G28 X"} -# Parameters that would be passed with the method above +# # enable: {{ 'screws_tilt_adjust' in printer.config_sections and printer.power_devices.count > 0 }} # Enable allows hiding of a menu if the condition is false. (evaluated with Jinja2) -# Available variables are listed below. +# Available variables are listed in the next section. +# +# --- The items below do not work if you define a panel to be loaded --- +# +# method: printer.gcode.script +# Moonraker method to call when the item is selected, you will need params below +# the most common is is printer.gcode.script check out other methods in moonraker documentation: +# https://moonraker.readthedocs.io/en/latest/web_api/#run-a-gcode +# +# params: {"script":"G28 X"} +# Parameters that would be passed with the method above +# +# confirm: 'Are you sure?' +# If present this option will give you a confirmation prompt with the text above. +# It's recommended that you use a Macro-prompt instead of this option, +# as the Macro-prompt will also be shown on other interfaces, and it's more flexible. +# Macro-prompts are described in: https://klipperscreen.github.io/KlipperScreen/macros/#prompts ``` -Available panels are listed here: [docs/panels.md](Panels.md) -Certain variables are available for conditional testing of the enable statement: + +Variables to conditionally test the enable statement: ```{ .yaml .no-copy } # Configured in Moonraker moonraker.power_devices.count # Number of power devices