Documentation
¶
Overview ¶
Package linter checks a cheatmd cheats directory for problems.
It runs three categories of checks:
- DSL syntax: each line inside a `<!-- cheat -->` block must be one of `var`/`if`/`fi`/`export`/`import`, blank, or a `#` comment. Var names must be valid; `if` must have a matching `fi`.
- References: every `import foo` must resolve to an `export foo` defined somewhere in the index. Duplicate `export` names are flagged. `$var`/`<var>` references in commands should be declared (in a cheat block or imported module), and undeclared references are warnings.
- Structural: empty `##` headers, missing code blocks, duplicate cheat headers across the linted input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
File string
Line int // 1-indexed; 0 means "file-level" (no specific line)
Column int // 1-indexed; 0 means "line-level"
Severity Severity
Message string
}
Finding is one issue surfaced by the linter.
func Lint ¶
Lint walks path (file or directory), parses every markdown file, and returns all findings sorted by file/line.
func LintWithConfig ¶
LintWithConfig walks path (file or directory), parses every markdown file, and returns findings using cfg for runtime-sensitive checks such as variable syntax and declaration-free prompting.
type RefKind ¶
type RefKind int
RefKind enumerates the different types of semantic references found in cheatmd Markdown.
Click to show internal directories.
Click to hide internal directories.