From 93bfd674db24ab286dc218f2d3bcc251dbc6195e Mon Sep 17 00:00:00 2001 From: Gavin Clarke <431018+gavinclarkeuk@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:58:18 +0000 Subject: [PATCH] Add more template input examples to docs Signed-off-by: Gavin Clarke <431018+gavinclarkeuk@users.noreply.github.com> --- .../software-templates/input-examples.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/docs/features/software-templates/input-examples.md b/docs/features/software-templates/input-examples.md index ef90013e49..0162ffb8f3 100644 --- a/docs/features/software-templates/input-examples.md +++ b/docs/features/software-templates/input-examples.md @@ -198,6 +198,23 @@ parameters: ui:widget: checkboxes ``` +## Markdown text blocks + +```yaml +parameters: + - title: Fill in some steps + properties: + markdown: + type: 'null' # Needs to be quoted + description: | + ## Markdown Text Block + + Standard markdown formatting is supported including *italics*, **bold** and [links](https://example.com) + + * bullet 1 + * bullet 2 +``` + ## Use parameters as condition in steps Conditions use Javascript equality operators. @@ -250,6 +267,54 @@ parameters: - lastName ``` +### Multiple conditional fields with custom ordering + +```yaml +parameters: + - title: Fill in some steps + ui:order: + - includeName + - lastName + - includeAddress + - address + properties: + includeName: + title: Include Name? + type: boolean + default: true + includeAddress: + title: Include Address? + type: boolean + default: true + dependencies: + includeName: + allOf: + - if: + properties: + includeName: + const: true + then: + properties: + lastName: + title: Name + type: string + required: + - lastName + includeAddress: + allOf: + - if: + properties: + includeAddress: + const: true + then: + properties: + address: + title: Address + type: string + required: + - address +``` + ## Conditionally set parameters The `if` keyword within the parameter uses [nunjucks templating](https://mozilla.github.io/nunjucks/templating.html#if). The `not` keyword is unavailable; instead, use javascript equality.