Documentation
¶
Index ¶
- type CodeBlockRule
- type ForbiddenTextRule
- type FrontmatterGenerator
- type FrontmatterRule
- type Generator
- type HeadingRule
- type ImageRule
- type LinkValidationRule
- type ListRule
- type RequiredTextRule
- type Rule
- type Severity
- type StructuralRule
- type StructureRule
- type TableRule
- type Validator
- type Violation
- type WordCountRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeBlockRule ¶
type CodeBlockRule struct {
}
CodeBlockRule validates code blocks using the hierarchical AST
func NewCodeBlockRule ¶
func NewCodeBlockRule() *CodeBlockRule
NewCodeBlockRule creates a new simplified code block rule
func (*CodeBlockRule) GenerateContent ¶
func (r *CodeBlockRule) GenerateContent(builder *strings.Builder, element schema.StructureElement) bool
GenerateContent generates placeholder code blocks for code block rules
func (*CodeBlockRule) ValidateWithContext ¶
func (r *CodeBlockRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates using VAST (validation-ready AST)
type ForbiddenTextRule ¶ added in v0.4.0
type ForbiddenTextRule struct {
}
ForbiddenTextRule validates that forbidden text patterns do not appear in sections
func NewForbiddenTextRule ¶ added in v0.4.0
func NewForbiddenTextRule() *ForbiddenTextRule
NewForbiddenTextRule creates a new forbidden text rule
func (*ForbiddenTextRule) GenerateContent ¶ added in v0.4.0
func (r *ForbiddenTextRule) GenerateContent(builder *strings.Builder, element schema.StructureElement) bool
GenerateContent generates placeholder content for forbidden text rules
func (*ForbiddenTextRule) Name ¶ added in v0.4.0
func (r *ForbiddenTextRule) Name() string
Name returns the rule identifier
func (*ForbiddenTextRule) ValidateWithContext ¶ added in v0.4.0
func (r *ForbiddenTextRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates using VAST (validation-ready AST)
type FrontmatterGenerator ¶ added in v0.4.0
FrontmatterGenerator generates document-level frontmatter content
type FrontmatterRule ¶ added in v0.4.0
type FrontmatterRule struct {
}
FrontmatterRule validates YAML frontmatter at the start of documents
func NewFrontmatterRule ¶ added in v0.4.0
func NewFrontmatterRule() *FrontmatterRule
NewFrontmatterRule creates a new frontmatter rule
func (*FrontmatterRule) Generate ¶ added in v0.4.0
Generate generates YAML frontmatter based on schema configuration
func (*FrontmatterRule) Name ¶ added in v0.4.0
func (r *FrontmatterRule) Name() string
Name returns the rule identifier
func (*FrontmatterRule) ValidateWithContext ¶ added in v0.4.0
func (r *FrontmatterRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates using VAST (validation-ready AST)
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator creates markdown content using rules
func NewGenerator ¶
func NewGenerator() *Generator
NewGenerator creates a generator that uses the same rules as the validator
func (*Generator) GenerateContent ¶
func (g *Generator) GenerateContent(builder *strings.Builder, element schema.StructureElement)
GenerateContent generates content for an element using all applicable rules
type HeadingRule ¶ added in v0.4.0
type HeadingRule struct {
}
HeadingRule validates heading structure across the document
func NewHeadingRule ¶ added in v0.4.0
func NewHeadingRule() *HeadingRule
NewHeadingRule creates a new heading rule
func (*HeadingRule) Name ¶ added in v0.4.0
func (r *HeadingRule) Name() string
Name returns the rule identifier
func (*HeadingRule) ValidateWithContext ¶ added in v0.4.0
func (r *HeadingRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates using VAST (validation-ready AST)
type ImageRule ¶ added in v0.4.0
type ImageRule struct {
}
ImageRule validates images using the hierarchical AST
func NewImageRule ¶ added in v0.4.0
func NewImageRule() *ImageRule
NewImageRule creates a new image rule
func (*ImageRule) GenerateContent ¶ added in v0.4.0
GenerateContent generates placeholder images for image rules
type LinkValidationRule ¶ added in v0.3.0
type LinkValidationRule struct {
}
LinkValidationRule validates internal and external links in the document
func NewLinkValidationRule ¶ added in v0.3.0
func NewLinkValidationRule() *LinkValidationRule
NewLinkValidationRule creates a new link validation rule
func (*LinkValidationRule) Name ¶ added in v0.3.0
func (r *LinkValidationRule) Name() string
Name returns the rule identifier
func (*LinkValidationRule) ValidateWithContext ¶ added in v0.3.0
func (r *LinkValidationRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates links based on schema configuration
type ListRule ¶ added in v0.4.0
type ListRule struct {
}
ListRule validates lists using the hierarchical AST
func (*ListRule) GenerateContent ¶ added in v0.4.0
GenerateContent generates placeholder lists for list rules
type RequiredTextRule ¶
type RequiredTextRule struct {
}
RequiredTextRule validates required text within sections
func NewRequiredTextRule ¶
func NewRequiredTextRule() *RequiredTextRule
NewRequiredTextRule creates a new section content rule
func (*RequiredTextRule) GenerateContent ¶
func (r *RequiredTextRule) GenerateContent(builder *strings.Builder, element schema.StructureElement) bool
GenerateContent generates placeholder content for required text rules
func (*RequiredTextRule) Name ¶
func (r *RequiredTextRule) Name() string
Name returns the rule identifier
func (*RequiredTextRule) ValidateWithContext ¶
func (r *RequiredTextRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates using VAST (validation-ready AST)
type Rule ¶ added in v0.4.0
type Rule interface {
// Name returns the rule identifier
Name() string
// ValidateWithContext uses pre-established section-schema mappings via VAST
ValidateWithContext(ctx *vast.Context) []Violation
}
Rule is the base interface for all validation rules
type StructuralRule ¶ added in v0.4.0
type StructuralRule interface {
Rule
// GenerateContent generates markdown content for elements that match this rule
// Returns true if the rule handled content generation for this element
GenerateContent(builder *strings.Builder, element schema.StructureElement) bool
}
StructuralRule validates and generates content for structure elements (sections)
type StructureRule ¶
type StructureRule struct {
// contains filtered or unexported fields
}
StructureRule validates document structure using the hierarchical AST
func NewStructureRule ¶
func NewStructureRule() *StructureRule
NewStructureRule creates a new simplified structure rule
func (*StructureRule) GenerateContent ¶
func (r *StructureRule) GenerateContent(builder *strings.Builder, element schema.StructureElement) bool
GenerateContent generates structural organization and ordering information
func (*StructureRule) ValidateWithContext ¶
func (r *StructureRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates using VAST (validation-ready AST)
type TableRule ¶ added in v0.4.0
type TableRule struct {
}
TableRule validates tables using the hierarchical AST
func NewTableRule ¶ added in v0.4.0
func NewTableRule() *TableRule
NewTableRule creates a new table rule
func (*TableRule) GenerateContent ¶ added in v0.4.0
GenerateContent generates placeholder tables for table rules
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator manages and runs all rules
func NewValidator ¶
func NewValidator() *Validator
NewValidator creates a new validator with default rules for v0.1 DSL
type Violation ¶
type Violation struct {
Rule string
Message string
Path string
Line int
Column int
Severity Severity
}
Violation represents a rule violation
func NewViolation ¶ added in v0.4.0
NewViolation creates a violation with default severity (error)
func (Violation) WithSeverity ¶ added in v0.4.0
WithSeverity returns a copy of the violation with the specified severity
type WordCountRule ¶ added in v0.4.0
type WordCountRule struct {
}
WordCountRule validates word count requirements for sections
func NewWordCountRule ¶ added in v0.4.0
func NewWordCountRule() *WordCountRule
NewWordCountRule creates a new word count rule
func (*WordCountRule) GenerateContent ¶ added in v0.4.0
func (r *WordCountRule) GenerateContent(builder *strings.Builder, element schema.StructureElement) bool
GenerateContent generates placeholder content for word count rules
func (*WordCountRule) Name ¶ added in v0.4.0
func (r *WordCountRule) Name() string
Name returns the rule identifier
func (*WordCountRule) ValidateWithContext ¶ added in v0.4.0
func (r *WordCountRule) ValidateWithContext(ctx *vast.Context) []Violation
ValidateWithContext validates using VAST (validation-ready AST)