From 4da24e12704e9bbacf88c892525940aba1ef259e Mon Sep 17 00:00:00 2001 From: Marvin Wendt Date: Fri, 9 Feb 2024 15:02:42 +0100 Subject: [PATCH] docs: added select type docs --- docs/syntax/types/select.md | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/syntax/types/select.md diff --git a/docs/syntax/types/select.md b/docs/syntax/types/select.md new file mode 100644 index 0000000..1a11f19 --- /dev/null +++ b/docs/syntax/types/select.md @@ -0,0 +1,40 @@ +# Select + +The `select` type can be used to define variables that accept a single option from a list of predefined options. + +## Basic + +Basic syntax for the `select` type: + +```yaml +variables: + - name: Color + type: select # Set the type to select + options: # Define the options + - name: Red + - name: Green + - name: Blue + description: Favorite color +template: |- + Your favorite color is {{ .Color }}. +``` + +## Custom values + +You can use the `value` property to define custom values for the options: + +```yaml +variables: + - name: Color + type: select + options: + - name: Red + value: "#ff0000" # Set the value to a hex color code + - name: Green + value: "#00ff00" + - name: Blue + value: "#0000ff" + description: Favorite color +template: |- + Your favorite color is {{ .Color }}. +```