Documentation
¶
Overview ¶
Package placeholders provides a shared vocabulary of placeholder tokens that rules can opt into to treat template content as opaque rather than content violations.
A rule adds a `placeholders:` setting (a list of token names) via the Configurable interface. When checking a node it calls ContainsBodyToken or MaskBodyTokens to decide whether to skip or neutralize the content.
The four initial tokens are:
- var-token — {identifier} interpolation placeholders
- heading-question — headings whose text is exactly "?"
- placeholder-section — headings whose text is exactly "..."
- cue-frontmatter — CUE constraint expressions in front-matter values
Index ¶
Constants ¶
const ( VarToken = "var-token" HeadingQuestion = "heading-question" PlaceholderSection = "placeholder-section" CUEFrontmatter = "cue-frontmatter" )
Named placeholder tokens.
Variables ¶
This section is empty.
Functions ¶
func ContainsBodyToken ¶
ContainsBodyToken reports whether text matches any of the named body tokens. cue-frontmatter is a front-matter–only token and is ignored.
func HasCUEFrontmatter ¶
HasCUEFrontmatter reports whether cue-frontmatter is in the token list.
func IsAllBodyTokens ¶
IsAllBodyTokens reports whether text (trimmed) consists only of placeholder token patterns, with no other content. Unlike MaskBodyTokens, this strips placeholder patterns to empty rather than replacing with neutral text, so only non-placeholder content remains.
func MaskBodyTokens ¶
MaskBodyTokens replaces placeholder token patterns in text with neutral content. cue-frontmatter is not a body token and is left unchanged. Whole-text tokens (heading-question, placeholder-section) replace the entire text when they match; substring tokens (var-token) replace each occurrence in place.
Types ¶
This section is empty.