docs: update menu close #1322

This commit is contained in:
alfrix 2024-04-07 08:47:43 -03:00
parent 7d226d25d1
commit 11cebe8c11

View File

@ -156,9 +156,10 @@ A menu item is configured as follows:
```{ .ini .no-copy } ```{ .ini .no-copy }
[menu __main my_menu_item] [menu __main my_menu_item]
name: Item Name 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: home
# Icon name to be used, it can be any image in the directory: # Icon name to be used, it can be any image in the directory:
# KlipperScreen/styles/{theme}/images/ where {theme} is your current theme # KlipperScreen/styles/{theme}/images/ where {theme} is your current theme
@ -166,19 +167,33 @@ name: Item Name
# #
# style: mycolor4 # style: mycolor4
# Icon style, defined as "button.mycolor4" (for example) in the theme css # Icon style, defined as "button.mycolor4" (for example) in the theme css
#
# panel: preheat # panel: preheat
# Panel from the panels folder in the KlipperScreen folder # 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: {{ '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) # 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 } ```{ .yaml .no-copy }
# Configured in Moonraker # Configured in Moonraker
moonraker.power_devices.count # Number of power devices moonraker.power_devices.count # Number of power devices