LiquidDoc
LiquidDoc gives you a way to create a structured interface for Liquid snippets and blocks, allowing you to specify input parameters, add descriptions, and provide usage examples. These details are exposed through theme checks, code completions, and hover information, making development faster and more reliable.
Anchor to Why use LiquidDoc?Why use Liquid Doc?
It can be easy to make a small mistake when writing Liquid code:
-
Missing required parameters don't trigger warnings
-
Unrecognized parameters pass through silently
-
No type checking ensures values match expected formats
-
Parameter discovery requires reading the code
For example, these misspelled parameters won't trigger errors:
sections/broken-section.liquid
LiquidDoc solves these problems by providing structured documentation that development tools can recognize, offering real-time feedback during development.
Anchor to Syntax referenceSyntax reference
LiquidDoc uses a JSDoc-inspired syntax to document snippets and blocks. The following tags are supported:
- @description - explains the purpose
- @param - documents expected parameters
- @example - shows usage examples
Anchor to Basic structureBasic structure
Place LiquidDoc content at the top of a snippet or a block file inside a doc
tag:
snippets/example-snippet.liquid
Anchor to Descriptions (,[object Object],)Descriptions (@description
)
@description
)You can document your snippet's or block's purpose in two ways:
snippets/example-snippet.liquid
Anchor to Usage notesUsage notes
- You can omit the
@description
tag by providing a description before any@
annotations. - If you provide multiple descriptions, then only the first one will appear when hovering over a render tag.
- Multi-line descriptions are automatically formatted to start on a new line.
Anchor to Parameters (,[object Object],)Parameters (@param
)
@param
)Parameters define the inputs accepted by a snippet or a static block with the following format:
@param {type} name - description
Component | Required | Description |
---|---|---|
Type | Optional | A data type in curly braces {} . Must be one of the supported types. |
Name | Required | A parameter identifier. For optional parameters, wrap in [] . For example, [max_items] . |
Description | Optional | An explanation of the parameter's purpose. |
The following example shows how to use parameters:
snippets/param-examples.liquid
Anchor to Supported parameter typesSupported parameter types
Type | Description |
---|---|
string | Text values |
number | Numeric values |
boolean | True/false values. All values in Liquid have truthy or falsy evaluation. |
object | Complex Liquid types or anything that's not a primitive |
Anchor to Examples (,[object Object],)Examples (@example
)
@example
)Examples demonstrate how a snippet or a static block should be used:
snippets/example-snippet.liquid
Anchor to Usage notesUsage notes
- Multiple examples help demonstrate different usage patterns.
- Multi-line examples are automatically formatted to start on a new line.
Anchor to Editor featuresEditor features
LiquidDoc speeds up development while catching parameter errors, typos, and type mismatches in real-time.
Anchor to Hover documentationHover documentation
See comprehensive information when hovering over a name in a render tag:

Anchor to Code completionCode completion
Get smart suggestions for parameter names when using documented snippets or static blocks:

Anchor to Parameter validationParameter validation
Receive warnings when required parameters are missing:

Anchor to Type checkingType checking
Get appropriate suggestions and validation based on type annotations in @param
tags.

When a type mismatch is detected, the editor suggests converting to these fallback values:
Type | Fallback value |
---|---|
string | '' |
number | 0 |
boolean | false |
object | N/A |
Anchor to Theme CheckTheme Check
LiquidDoc integrates with Theme Check to validate your snippets and blocks through:
- Documentation checks - Validate syntax and structure inside
{% doc %}
blocks - Usage checks - Ensure
{% render %}
tags properly use documented parameters
Anchor to Documentation checksDocumentation checks
Check | Description |
---|---|
UniqueDocParamNames | Each parameter defined in LiquidDoc needs to have a unique name. |
UnsupportedDocTag | The doc tag can only be used within a liquid snippet file. |
ValidDocParamNames | Each parameter defined in LiquidDoc should not collide with liquid tags and global variables. |
ValidDocParamTypes | Each parameter defined in LiquidDoc should be string , number , boolean , object , or any liquid object that isn't exclusively a global object. |
UnusedDocParam | The parameters defined within the doc tag must be used within the scope of the variable. |
Anchor to Usage checksUsage checks
Check | Description |
---|---|
DuplicateContentForArguments | Each named argument should be passed into the content_for tag only once. |
DuplicateRenderSnippetArguments | Each named argument should be passed into the render tag only once. |
MissingContentForArguments | When you render a static block, you must provide all required arguments defined in that block file's LiquidDoc. |
MissingRenderSnippetArguments | When you render a snippet, you must provide all required arguments defined in that snippet file's LiquidDoc. |
UnrecognizedContentForArguments | All arguments provided when rendering a static block must match the arguments defined in that block's LiquidDoc. |
UnrecognizedRenderSnippetArguments | All arguments provided when rendering a snippet must match the arguments defined in that snippet's LiquidDoc. |
ValidContentForArgumentTypes | All arguments provided when rendering a static block must match the respective parameter's type defined in that block's LiquidDoc. |
ValidRenderSnippetArgumentTypes | All arguments provided when rendering a snippet must match the respective parameter's type defined in that snippet's LiquidDoc. |
Check | Description |
---|---|
DuplicateRenderSnippetArguments | Each named argument should be passed into the render tag only once. |
MissingRenderSnippetArguments | When you render a snippet, you must provide all required arguments defined in that snippet file's LiquidDoc. |
UnrecognizedRenderSnippetArguments | All arguments provided when rendering a snippet must match the arguments defined in that snippet's LiquidDoc. |
ValidRenderSnippetArgumentTypes | All arguments provided when rendering a snippet must match the respective parameter's type defined in that snippet's LiquidDoc. |
Anchor to LimitationsLimitations
Anchor to Dynamic validationDynamic validation
Usage checks are disabled when the name is a variable:
Anchor to ✗ Disabled✗ Disabled
section-example.liquid
Anchor to ✓ Enabled✓ Enabled
section-example.liquid
Anchor to Dynamic type validationDynamic type validation
We don't currently validate the types of objects or variables passed as parameters: