Documentation
¶
Overview ¶
Package toc implements MDS038, the <?toc?> generated-section directive that emits a nested heading list linked to GitHub-style anchors.
Index ¶
- type Rule
- func (r *Rule) Category() string
- func (r *Rule) Check(f *lint.File) []lint.Diagnostic
- func (r *Rule) Fix(f *lint.File) []byte
- func (r *Rule) Generate(f *lint.File, filePath string, line int, params map[string]string, ...) (string, []lint.Diagnostic)
- func (r *Rule) ID() string
- func (r *Rule) Name() string
- func (r *Rule) RuleID() string
- func (r *Rule) RuleName() string
- func (r *Rule) Validate(filePath string, line int, params map[string]string, ...) []lint.Diagnostic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule checks and fixes <?toc?>...<?/toc?> generated sections.
engineOnce serialises lazy engine init; the rule is a registered singleton and the LSP server may call Check from concurrent goroutines, where a plain check-then-set on the engine field would race.
func (*Rule) Check ¶
func (r *Rule) Check(f *lint.File) []lint.Diagnostic
Check implements rule.Rule.
func (*Rule) Generate ¶
func (r *Rule) Generate(f *lint.File, filePath string, line int, params map[string]string, _ map[string]gensection.ColumnConfig, ) (string, []lint.Diagnostic)
Generate implements gensection.Directive.
func (*Rule) Validate ¶
func (r *Rule) Validate(filePath string, line int, params map[string]string, _ map[string]gensection.ColumnConfig, ) []lint.Diagnostic
Validate implements gensection.Directive.
Click to show internal directories.
Click to hide internal directories.