Add support to LiquidDoc with the new {% doc %}
tag
#1895
+249
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements RFC#1865 and introduces support for the new
{% doc %}
tag, which will be used to document elements of Liquid templates, primarily snippets.Snippets are the primary method for reusing logic in Liquid. However, their weak interfaces make it easy to overlook dependencies when rendering them.
By adopting the emerging pattern of using headers on these snippets, the
{% doc %}
tag will document those interfaces. This way, tools such as the Liquid language server can support features around these definitions, such as code completion, better linting rules, and inline documentation. Here's an example of{% doc %}
in action:This new tag should behave just like the
{% comment %}
tag and have no effect on rendering. Therefore, to implement this, theDoc
tag inherits fromComment
, similar to howUnless
inherits fromIf
.