Skip to content

GTD Queries

github-actions[bot] edited this page Jun 25, 2022 · 317 revisions

GTD Queries module

Gets tasks, projects and useful information for the GTD system.

Overview

Custom gtd queries, that respect the neorg GTD specs (:h neorg-gtd-format)

Usage

How to Apply

  • To manually load the module, place this code in your Neorg setup:
    ["core.gtd.queries"] = {
       config = { -- Note that this table is optional and doesn't need to be provided
           -- Configuration here
       }
    }
    Consult the configuration section to see how you can configure core.gtd.queries to your liking.

Configuration

This module exposes no customization options.

Developer Usage

Public API

This segment will detail all of the functions core.gtd.queries exposes. All of these functions reside in the public table.

  • create
  • add_metadata
  • starting_after_today
  • get_tag
  • sort_by
  • get
  • get_end_project
  • update
  • date_converter
  • diff_with_today
  • insert
  • delete
  • get_at_cursor
  • modify
  • get_end_document_content

Examples

Get all tasks and projets from buffer

local buf = 1 -- The buffer to query informations

local queries = module.required["core.gtd.queries"]

local tasks = queries.get("tasks", { bufnr = buf })
local projects = queries.get("projects", { bufnr = buf })

print(tasks, projects)

Extra Info

Version

This module supports at least version 0.0.8. The current Neorg version is 0.0.11.

Imports

Requires

Required by

  • core.gtd.ui - Nicely displays GTD related information.
  • core.gtd.base - Manages your tasks with Neorg using the Getting Things Done methodology.