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

options

Table of contents

Description:

This key defines configuration options for literal parser configurations.

The value is an object that can contain literal and format properties. These options control what literal string value must be matched.

Appears in:
└── Snippet
    └── params
        └── *
            └── Literal Parser Configuration
                └── options
Type:
Object Required
Properties:
formatObject#

This key defines formatting options for literal parser configurations.

The value is an object that can contain string_boundary properties. These options control how the literal value is parsed and matched.

Show examplesHide examples

In this example, we have configured literal parser format options with string boundaries.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[literal_param]]>>
    params:
      literal_param:
        parser: literal
        options:
          literal: specific-value
          format:
            string_boundary:
              - '"'
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[literal_param]]>>",
      "params": {
        "literal_param": {
          "parser": "literal",
          "options": {
            "literal": "specific-value",
            "format": {
              "string_boundary": [
                "\""
              ]
            }
          }
        }
      }
    }
  }
}
literalstring Required#

This key defines the literal string value that must be matched for literal parser configurations.

The value is a string that specifies the exact text that must appear in the snippet for the parameter to match.

Show examplesHide examples

In this example, we have configured a literal value that must be matched.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[literal_param]]>>
    params:
      literal_param:
        parser: literal
        options:
          literal: specific-value
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[literal_param]]>>",
      "params": {
        "literal_param": {
          "parser": "literal",
          "options": {
            "literal": "specific-value"
          }
        }
      }
    }
  }
}
Examples:

In this example, we have configured literal parser options with a literal value.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[literal_param]]>>
    params:
      literal_param:
        parser: literal
        options:
          literal: specific-value
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[literal_param]]>>",
      "params": {
        "literal_param": {
          "parser": "literal",
          "options": {
            "literal": "specific-value"
          }
        }
      }
    }
  }
}
Open in a new tab