intro.adoc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [#args]
  2. = Introduction to Arguments
  3. Actions and commands that OliveTin runs, without arguments, are generally quite safe - only that command can be run, without modifications. However, many users need the flexibility to set options on that command - normally called command line arguments. In OliveTin, arguments are defined in a shell commands like `echo {{ message }}`, with a bit of extra configuration.
  4. Examples of valid argument names are `{{ personName }}`, `{{ customer_number }}` and `{{ ISBN11_code }}`.
  5. * a-z (case insensitive)
  6. * _ is allowed
  7. * numbers are allowed (argument names can also start with numbers)
  8. * all other characters are invalid for argument names.
  9. [#arg-descriptions]
  10. == Argument descriptions
  11. Each argument can include a `description:` shown under the field on the argument form. OliveTin renders that value as **raw HTML**, so you can use markup such as links, line breaks, or emphasis:
  12. [source,yaml]
  13. ----
  14. arguments:
  15. - name: host
  16. title: Hostname
  17. type: ascii_identifier
  18. description: |
  19. Enter a host OliveTin can reach.
  20. See the <a href="https://example.com/docs" target="_blank" rel="noopener noreferrer">network guide</a>.
  21. ----
  22. Treat `description` as trusted markup that you control (the same trust model as xref:dashboards/4-displays.adoc[dashboard displays]). Do not put untrusted or entity-derived strings into it without careful escaping.
  23. == What's Next?
  24. Now that you understand how arguments work, explore the different argument types and features:
  25. * xref:args/types.adoc[Argument types] - Learn about different input types (text, dropdown, checkbox, etc.)
  26. * xref:args/safety.adoc[Argument safety] - Understand how OliveTin keeps arguments safe
  27. * xref:args/suggestions.adoc[Argument suggestions] - Add dynamic suggestions to help users
  28. * xref:args/regex.adoc[Input validation with regex] - Validate user input with regular expressions
  29. * xref:args/env.adoc[Environment variables] - Use arguments to set environment variables
  30. * xref:args/templates.adoc[Templates] - Use Go templates in actions, including JSON encoding
  31. * xref:action_examples/intro.adoc[See examples] - View real-world examples using arguments