Sign in

    todotxt

    A small parser for the todo.txt

    todo
    todotxt
    todos
    Download zip
    Version
    0.1.2
    License
    Apache-2.0
    Last updated
    3 months ago
    Downloads
    34

    No dependencies

    #shiguri-01/todotxt

    A small parser for the todo.txt.

    #Installation

    moon add shiguri-01/todotxt

    #Usage

    ///|
    let _task : @todotxt.Task = @todotxt.parse_task(
    "(A) 2026-06-22 Write README +todotxt @dev",
    ) catch {
    ParseError::EmptyLine => abort("Task must not be empty")
    ParseError::MultipleLines => abort("Task must be a single line")
    }

    #License

    ParseError

    pub(all) suberror ParseError {
    EmptyLine
    MultipleLines
    } derive(Eq,
    Debug
    )

    Date

    pub struct Date {
    year : Int
    month : Int
    day : Int
    } derive(Eq,
    Debug
    )

    Date::Date

    fn Date::Date(year~ : Int, month~ : Int, day~ : Int) -> Date raise Failure

    Status

    pub(all) enum Status {
    Todo(priority~ : String?)
    Done(completed_date~ : Date)
    } derive(Eq,
    Debug
    )

    Task

    pub(all) struct Task {
    status : Status
    prepended_date : Date?
    description : String
    contexts : Array[String]
    projects : Array[String]
    metadata : Map[String, String]
    } derive(Eq,
    Debug
    )

    parse_task

    fn parse_task(line : String) -> Task raise ParseError

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io