☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

Argument List Parser Configuration

Table of contents

Description:

This key defines a parser configuration that parses a list of distinct positional arguments based on their position.

Appears in:
└── Snippet
    └── params
        └── *
            └── Argument List Parser Configuration
Type:
Object
Properties:
optionsObject Required#

This key defines configuration options for argument list parser configurations.

The value is an object that can contain models and format properties. These options control how multiple argument values are parsed and validated.

Show examplesHide examples

In this example, we have configured argument list parser options with multiple models.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param1]] [[param2]]>>
    params:
      params:
        parser: argument_list
        options:
          models:
            - editor_key: param1
            - editor_key: param2
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param1]] [[param2]]>>",
      "params": {
        "params": {
          "parser": "argument_list",
          "options": {
            "models": [
              {
                "editor_key": "param1"
              },
              {
                "editor_key": "param2"
              }
            ]
          }
        }
      }
    }
  }
}
parser"argument_list" Required#

This key defines the parser type for argument list parser configurations.

The value must be argument_list. This specifies that the parameter uses the argument list parser, which parses multiple argument values.

Show examplesHide examples

In this example, we have configured an argument list parser for a snippet parameter.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param1]] [[param2]]>>
    params:
      params:
        parser: argument_list
        options:
          models:
            - editor_key: param1
            - editor_key: param2
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param1]] [[param2]]>>",
      "params": {
        "params": {
          "parser": "argument_list",
          "options": {
            "models": [
              {
                "editor_key": "param1"
              },
              {
                "editor_key": "param2"
              }
            ]
          }
        }
      }
    }
  }
}
Examples:

In this example, we have configured an argument list parser to parse distinct positional arguments based on their position.

Markdown
Copied to clipboard
{{<figure "image.png" "My image title">}}
          └──────────────────────────┘
Open in a new tab