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

Literal Parser Configuration

Table of contents

Description:

This key defines a parser configuration that parses an exact literal value. Mainly useful when configuring a snippet template.

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

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.

Show examplesHide 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"
          }
        }
      }
    }
  }
}
parser"literal" Required#

This key defines the parser type for literal parser configurations.

The value must be literal. This specifies that the parameter uses the literal parser, which matches a specific literal string value.

Show examplesHide examples

In this example, we have configured a literal parser for a snippet parameter.

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:
Open in a new tab