Expand description
Extract Emacs Org-mode tasks from markdown files.
This is the library behind the markdown-org-extract command-line tool.
Both entry points run the same code: the binary parses arguments and writes
bytes, everything below that line lives here. See README.md at the
repository root for the user-facing description of the format itself.
§Pipeline
A run is two steps, and they are separate so a caller can hold on to the tasks and build several agendas from one scan:
scan_directorywalks a directory and returns everyTaskit finds.filter_agendaturns those tasks into anAgendaOutputfor a givenAgendaScopeand date window.
use markdown_org_extract::{filter_agenda, scan_directory, AgendaDates, AgendaScope, ScanOptions};
let outcome = scan_directory("notes".as_ref(), &ScanOptions::default(), None)?;
let agenda = filter_agenda(
outcome.tasks,
AgendaScope::Day,
AgendaDates::default(),
"Europe/Moscow",
false,
false,
true,
)?;§Determinism
Nothing here reads the wall clock unless it has to: AgendaDates::current_date
overrides “today” so a caller can render the agenda as it would look on any
date. Consumers are expected to pass it rather than rely on the host clock.
Re-exports§
pub use crate::agenda::filter_agenda;pub use crate::agenda::AgendaDates;pub use crate::agenda::AgendaOutput;pub use crate::agenda::AgendaScope;pub use crate::error::AppError;pub use crate::holidays::HolidayCalendar;pub use crate::locale::get_weekday_mappings;pub use crate::parser::display_text;pub use crate::parser::extract_tasks;pub use crate::parser::extract_tasks_with_counter;pub use crate::parser::parse_heading_line;pub use crate::parser::HeadingLine;pub use crate::parser::HeadingToken;pub use crate::render::render_days_html;pub use crate::render::render_days_markdown;pub use crate::render::render_html;pub use crate::render::render_markdown;pub use crate::scan::scan_directories;pub use crate::scan::scan_directory;pub use crate::scan::ScanOptions;pub use crate::scan::ScanOutcome;pub use crate::timestamp::add_months;pub use crate::timestamp::closest_date;pub use crate::timestamp::parse_timestamp_parts;pub use crate::timestamp::DatePreference;pub use crate::timestamp::Repeater;pub use crate::timestamp::RepeaterType;pub use crate::timestamp::RepeaterUnit;pub use crate::timestamp::TimestampParts;pub use crate::types::ClockEntry;pub use crate::types::DayAgenda;pub use crate::types::Priority;pub use crate::types::ProcessingStats;pub use crate::types::Task;pub use crate::types::TaskType;pub use crate::types::TaskWithOffset;pub use crate::types::DEFAULT_MAX_TASKS;pub use crate::types::MAX_FILE_SIZE;
Modules§
- agenda
- Turning a flat task list into a dated agenda.
- clock
- Org-mode
CLOCK:entries — extraction and duration arithmetic. - error
- The single error type returned by the library.
- holidays
- Russian production calendar: which dates are days off and which are working.
- locale
- Weekday-name translation tables.
- parser
- Markdown to tasks: the extraction step itself.
- render
- Rendering tasks and agendas as markdown or HTML.
- scan
- Directory scanning: walk a tree, pre-filter by glob and by content, then
parse matching files into
Tasks. - timestamp
- Org-mode timestamp parsing and repeater logic.
- types
- The data model shared by every stage of the pipeline.