Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultFile ¶
CreateDefaultFile creates a .mdschema.yml file with default configuration
func FindSchema ¶
FindSchema discovers schema files in the directory hierarchy
Types ¶
type CodeBlockRule ¶
type CodeBlockRule struct {
Lang string `yaml:"lang"`
Min int `yaml:"min,omitempty"`
Max int `yaml:"max,omitempty"`
}
CodeBlockRule defines validation for code blocks within a section
type Schema ¶
type Schema struct {
// Document structure with embedded section rules
Structure []StructureElement `yaml:"structure,omitempty"`
}
Schema represents the validation rules for Markdown files (v0.1 DSL)
func LoadMultiple ¶
LoadMultiple loads multiple schemas
type SectionRules ¶
type SectionRules struct {
// Required text/substrings within the section
RequiredText []string `yaml:"required_text,omitempty"`
// Code block requirements within this section
CodeBlocks []CodeBlockRule `yaml:"code_blocks,omitempty"`
}
SectionRules defines validation rules scoped to a specific heading/section
type StructureElement ¶
type StructureElement struct {
// Heading pattern
Heading string `yaml:"heading,omitempty"`
// Optional element flag
Optional bool `yaml:"optional,omitempty"`
// Hierarchical children elements
Children []StructureElement `yaml:"children,omitempty"`
// Embedded section rules for validation within this element's scope
*SectionRules `yaml:",inline"`
}
StructureElement represents an element in the document structure Supports hierarchical structure with children and section-scoped rules
func (*StructureElement) UnmarshalYAML ¶
func (se *StructureElement) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML implements custom unmarshaling to support the new hierarchical syntax
Click to show internal directories.
Click to hide internal directories.