TaskValidator.Parsers.TaskExtractor (TaskValidator v0.9.5)
View SourceExtracts tasks from markdown table and detailed sections.
This module specializes in parsing different task formats found in TaskList documents, including table rows and detailed task sections with subtasks.
Summary
Functions
Extracts detailed task sections from markdown content.
Extracts tasks from a markdown table section.
Extracts subtasks from a task content section.
Merges table tasks with their detailed task information.
Functions
Extracts detailed task sections from markdown content.
Looks for sections that start with "### TASKID:" and extracts all content and subtasks for each task.
@spec extract_from_table([String.t()], String.t(), atom()) :: {:ok, [TaskValidator.Core.Task.t()]} | {:error, String.t()}
Extracts tasks from a markdown table section.
Parameters
lines
: List of markdown linessection_header
: The header to look for (e.g., "## Current Tasks")default_status
: Default status to assign to tasks from this section
Returns
{:ok, list(Task.t())}
with extracted tasks or {:error, reason}
@spec extract_subtasks([String.t()]) :: [TaskValidator.Core.Task.t()]
Extracts subtasks from a task content section.
Supports both numbered subtasks (#### 1. Description (TASK001-1)) and checkbox subtasks (- [x] Description [TASK001a]).
@spec merge_table_with_details([TaskValidator.Core.Task.t()], [map()]) :: [ TaskValidator.Core.Task.t() ]
Merges table tasks with their detailed task information.
Table tasks provide basic metadata while detailed tasks provide full content, subtasks, and additional fields.