TaskValidator.Parsers.ReferenceResolver (TaskValidator v0.9.5)
View SourceHandles reference resolution and validation in TaskList documents.
References allow for content reuse and reduce file size by 60-70%. This module validates reference integrity without expanding them, as the TaskValidator only checks that references exist.
Summary
Functions
Expands a single reference placeholder with its definition.
Extracts reference definitions from markdown lines.
Finds all reference placeholders used in the content.
Gets statistics about reference usage in a TaskList.
Validates reference integrity for a TaskList.
Validates that all reference placeholders have corresponding definitions.
Functions
Expands a single reference placeholder with its definition.
This function is provided for completeness but is not used by the TaskValidator, which only validates reference existence.
Extracts reference definitions from markdown lines.
Reference definitions follow the format:
{{reference-name}} or ## #{{reference-name}}
Returns a map where keys are reference names and values are the content lines.
Finds all reference placeholders used in the content.
Returns a list of {reference_name, line_number} tuples for all {{reference-name}} placeholders found in the document.
@spec reference_stats(TaskValidator.Core.TaskList.t()) :: map()
Gets statistics about reference usage in a TaskList.
Validates reference integrity for a TaskList.
This is the main validation function that ensures all used references have corresponding definitions.
@spec validate_references(TaskValidator.Core.TaskList.t()) :: TaskValidator.Core.ValidationResult.t()
Validates that all reference placeholders have corresponding definitions.
This function does NOT expand references - it only validates that every {{reference-name}} placeholder has a matching ## #{{reference-name}} definition.