Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentChecksum ¶
func LoadSectionTemplate ¶
LoadSectionTemplate reads the section template file from .vaultmind/sections/{noteType}/{sectionKey}.md inside the vault. Returns MutationError{Code: "template_not_found"} if the file is absent.
func ReplaceRegion ¶
ReplaceRegion replaces the content between markers for a given section_key. Inserts a checksum comment after START. Returns checksum_mismatch error if hand-edited and force is false.
Types ¶
type Issue ¶
type Issue struct {
SectionKey string `json:"section_key,omitempty"`
Rule string `json:"rule"`
Message string `json:"message"`
Line int `json:"line"`
}
Issue represents a marker validation problem found in a file.
func ValidateMarkers ¶
ValidateMarkers inspects raw file bytes for marker problems and returns a slice of Issues. An empty slice means the file is clean.
type Marker ¶
type Marker struct {
SectionKey string
StartOffset int
EndOffset int
ContentStart int
ContentEnd int
Checksum string
Content string
}
Marker represents a detected generated region in a file.
func FindMarkers ¶
type RenderConfig ¶
type RenderConfig struct {
VaultPath string
Target string
SectionKey string
DryRun bool
Diff bool
Commit bool
Force bool
Detector git.RepoStateDetector
Checker *git.PolicyChecker
Committer *git.Committer
}
RenderConfig configures the RenderRegion orchestrator.
type RenderResult ¶
type RenderResult struct {
Path string `json:"path"`
ID string `json:"id"`
SectionKey string `json:"section_key"`
Operation string `json:"operation"`
DryRun bool `json:"dry_run"`
Diff string `json:"diff,omitempty"`
WriteHash string `json:"write_hash,omitempty"`
Git mutation.GitInfo `json:"git"`
ReindexRequired bool `json:"reindex_required"`
Warnings []mutation.PolicyWarning `json:"warnings"`
}
RenderResult is the response from RenderRegion.
func RenderRegion ¶
func RenderRegion(cfg RenderConfig) (*RenderResult, error)
RenderRegion orchestrates the dataview region rendering pipeline:
- Read file from vault
- Extract note type from frontmatter
- Load section template from .vaultmind/sections/{type}/{key}.md
- Call ReplaceRegion to splice content
- Generate diff if requested
- If dry-run, return early
- Git policy check
- Conflict detection (re-read + hash compare)
- Atomic write (temp + rename + chmod)
- Return result