Liking cljdoc? Tell your friends :D

dgknght.caldav

Talk to a CalDAV server (RFC 4791), storing calendar resources of one component type, such as VTODO.

A connection is a map described by the ::connection spec:

:url The server's CalDAV URL, e.g. https://example.com/dav.php/, or just its root, e.g. https://example.com/, in which case the /.well-known/caldav URL (RFC 6764) is tried as well :username String :password String :calendar Optional. The ID of the calendar to fetch and create resources in: the last segment of a calendar's :url as returned by calendars, e.g. tasks for https://example.com/dav.php/calendars/me/tasks/. Only needed when more than one calendar can hold the component

A component describes the type of resource stored:

:name The iCalendar component's name, e.g. "VTODO" :spec The spec a resource must satisfy to be written :parse A function of iCalendar text to a resource, or nil when the text holds none :serialize A function of a resource to iCalendar text :noun What the resource is called in error messages, e.g. "task"

Resources come back with the :url of the CalDAV resource holding them and its :etag, which updating or deleting them requires.

Failures throw an ex-info whose data has a :type of:

::invalid-connection The connection map isn't a valid ::connection ::invalid-resource The resource can't be written: it doesn't satisfy the component's :spec, or it's being updated or deleted without the :url and :etag it was fetched with ::authentication-failed The server rejected the credentials (401) ::unreachable The server couldn't be reached ::conflict The resource was changed on the server since it was fetched, or one already exists where a new one was being created (412) ::calendar-not-found No calendar that can hold the component matches the connection's :calendar, or there's none at all ::ambiguous-calendar The connection has no :calendar and more than one calendar can hold the component ::unexpected-response The server responded with something else

Talk to a CalDAV server (RFC 4791), storing calendar resources of one
component type, such as VTODO.

A connection is a map described by the `::connection` spec:

  :url       The server's CalDAV URL, e.g. https://example.com/dav.php/,
             or just its root, e.g. https://example.com/, in which case
             the /.well-known/caldav URL (RFC 6764) is tried as well
  :username  String
  :password  String
  :calendar  Optional. The ID of the calendar to fetch and create
             resources in: the last segment of a calendar's :url as
             returned by `calendars`, e.g. tasks for
             https://example.com/dav.php/calendars/me/tasks/. Only needed
             when more than one calendar can hold the component

A component describes the type of resource stored:

  :name       The iCalendar component's name, e.g. "VTODO"
  :spec       The spec a resource must satisfy to be written
  :parse      A function of iCalendar text to a resource, or nil when the
              text holds none
  :serialize  A function of a resource to iCalendar text
  :noun       What the resource is called in error messages, e.g. "task"

Resources come back with the :url of the CalDAV resource holding them and
its :etag, which updating or deleting them requires.

Failures throw an ex-info whose data has a :type of:

  ::invalid-connection     The connection map isn't a valid ::connection
  ::invalid-resource       The resource can't be written: it doesn't
                           satisfy the component's :spec, or it's being
                           updated or deleted without the :url and :etag it
                           was fetched with
  ::authentication-failed  The server rejected the credentials (401)
  ::unreachable            The server couldn't be reached
  ::conflict               The resource was changed on the server since it
                           was fetched, or one already exists where a new
                           one was being created (412)
  ::calendar-not-found     No calendar that can hold the component matches
                           the connection's :calendar, or there's none at
                           all
  ::ambiguous-calendar     The connection has no :calendar and more than
                           one calendar can hold the component
  ::unexpected-response    The server responded with something else
raw docstring

dgknght.ical

iCalendar (RFC 5545) helpers over ical4j that don't depend on the type of component, shared by the namespaces that convert between a component, such as a VTODO, and a map.

Dates and times are java.time values: a LocalDate (all-day), LocalDateTime (floating), ZonedDateTime (local time in a time zone) or Instant (UTC).

Data a map doesn't model is kept as iCalendar text, so that a parse/serialize round trip doesn't drop data written by other clients: properties under :extra-properties, subcomponents (e.g. VALARM) under :extra-components, and time zone definitions that can't be regenerated from the time zone database under :extra-timezones.

iCalendar (RFC 5545) helpers over ical4j that don't depend on the type of
component, shared by the namespaces that convert between a component, such
as a VTODO, and a map.

Dates and times are java.time values: a LocalDate (all-day), LocalDateTime
(floating), ZonedDateTime (local time in a time zone) or Instant (UTC).

Data a map doesn't model is kept as iCalendar text, so that a
parse/serialize round trip doesn't drop data written by other clients:
properties under `:extra-properties`, subcomponents (e.g. VALARM) under
`:extra-components`, and time zone definitions that can't be regenerated
from the time zone database under `:extra-timezones`.
raw docstring

dgknght.json

Encode java.time values as strings that can be written as JSON, and decode them again unchanged. Dates and times are ISO-8601 strings, whose form tells which kind they are:

2026-12-01 java.time.LocalDate 2026-12-01T17:00 java.time.LocalDateTime 2026-12-01T17:00:00Z java.time.Instant 2026-12-01T17:00-06:00[America/Chicago] java.time.ZonedDateTime

Encode java.time values as strings that can be written as JSON, and
decode them again unchanged. Dates and times are ISO-8601 strings, whose
form tells which kind they are:

  2026-12-01                                  java.time.LocalDate
  2026-12-01T17:00                            java.time.LocalDateTime
  2026-12-01T17:00:00Z                        java.time.Instant
  2026-12-01T17:00-06:00[America/Chicago]     java.time.ZonedDateTime
raw docstring

dgknght.json-file

Keep resources of one type, such as tasks, in a single JSON file.

A config is a map described by the ::config spec:

:path The file's path. It's created, along with any missing parent directories, the first time a resource is saved, and a missing file holds none

A component describes the type of resource stored:

:spec The spec a resource must satisfy to be saved :encode A function of a resource to JSON-ready data: a map with only the keys that are saved (see dgknght.json for dates and times) :decode A function of a map read back from JSON with string keys to a resource :noun What the resource is called in error messages, e.g. "task"

The file holds a JSON array of resources, one object each. A resource is identified by its :uid. Each change rewrites the whole file, replacing it atomically so that a reader never sees it half written. The file has no protection against several services or processes writing it at the same time, so callers serialize their changes and share one service per file.

Failures throw an ex-info whose data has a :type of:

::invalid-config The config map isn't a valid ::config ::invalid-resource The resource can't be saved: it doesn't satisfy the component's :spec, or it's being deleted without a :uid ::invalid-file The file isn't a JSON array of resources

Keep resources of one type, such as tasks, in a single JSON file.

A config is a map described by the `::config` spec:

  :path  The file's path. It's created, along with any missing parent
         directories, the first time a resource is saved, and a missing
         file holds none

A component describes the type of resource stored:

  :spec    The spec a resource must satisfy to be saved
  :encode  A function of a resource to JSON-ready data: a map with only
           the keys that are saved (see `dgknght.json` for dates and times)
  :decode  A function of a map read back from JSON with string keys to a
           resource
  :noun    What the resource is called in error messages, e.g. "task"

The file holds a JSON array of resources, one object each. A resource is
identified by its :uid. Each change rewrites the whole file, replacing it
atomically so that a reader never sees it half written. The file has no
protection against several services or processes writing it at the same
time, so callers serialize their changes and share one service per file.

Failures throw an ex-info whose data has a :type of:

  ::invalid-config    The config map isn't a valid ::config
  ::invalid-resource  The resource can't be saved: it doesn't satisfy the
                      component's :spec, or it's being deleted without a
                      :uid
  ::invalid-file      The file isn't a JSON array of resources
raw docstring

dgknght.logging

Helpers for the namespaces that log the calls made to a service, such as dgknght.tasks.logging and dgknght.memos.logging.

Helpers for the namespaces that log the calls made to a service, such as
`dgknght.tasks.logging` and `dgknght.memos.logging`.
raw docstring

dgknght.markdown-dir

Keep resources of one type, such as tasks, in a directory of Markdown files, one per resource, as Obsidian keeps notes. Since each change only touches the file of the resource changed, a file synchronization tool (Syncthing, Dropbox, etc.) can merge changes made in several places.

A config is a map described by the ::config spec:

:path The directory's path. It's created, along with any missing parent directories, the first time a resource is saved, and a missing directory holds none

A component describes the type of resource stored:

:spec The spec a resource must satisfy to be saved :encode A function of a resource to JSON-ready data: a map with only the keys that are saved (see dgknght.json for dates and times) :decode A function of a map read back from JSON with string keys to a resource :noun What the resource is called in error messages, e.g. "task"

Each file holds a resource's :description as its body, after a YAML front matter block with the rest of the encoded resource:


uid: 6b1f0c3e-2a4d-4e8f-9b7a-1c2d3e4f5a6b summary: Buy milk due: 2026-12-01 status: needs-action

The good kind

Only the directory's own files whose names end in .md are read, and those whose names start with a dot are left out. A file with no front matter is all body, and a file with no :uid takes its name, less the extension, as its :uid. Front matter keys with no value are left out. Leading blank lines and trailing whitespace aren't part of the body, and a blank body is no :description.

A resource is identified by its :uid, and two files holding the same :uid (as a synchronization tool's conflict copy would) make the directory unreadable until one is removed. A resource's file is named after its :summary, or its :uid when it has none, with characters that aren't allowed in file names (or in Obsidian links) replaced with -. When another file has that name, a number is added ("Buy milk 2.md"). The file is renamed when its resource is saved with a :summary that gives another name.

Each file is replaced atomically so that a reader never sees it half written. The directory has no protection against several services or processes writing it at the same time, so callers serialize their changes and share one service per directory.

Failures throw an ex-info whose data has a :type of:

::invalid-config The config map isn't a valid ::config ::invalid-resource The resource can't be saved: it doesn't satisfy the component's :spec, or it's being deleted without a :uid ::invalid-file A file can't be read as a resource, two files hold the same :uid, or the path isn't a directory

Keep resources of one type, such as tasks, in a directory of Markdown
files, one per resource, as Obsidian keeps notes. Since each change only
touches the file of the resource changed, a file synchronization tool
(Syncthing, Dropbox, etc.) can merge changes made in several places.

A config is a map described by the `::config` spec:

  :path  The directory's path. It's created, along with any missing parent
         directories, the first time a resource is saved, and a missing
         directory holds none

A component describes the type of resource stored:

  :spec    The spec a resource must satisfy to be saved
  :encode  A function of a resource to JSON-ready data: a map with only
           the keys that are saved (see `dgknght.json` for dates and times)
  :decode  A function of a map read back from JSON with string keys to a
           resource
  :noun    What the resource is called in error messages, e.g. "task"

Each file holds a resource's :description as its body, after a YAML front
matter block with the rest of the encoded resource:

  ---
  uid: 6b1f0c3e-2a4d-4e8f-9b7a-1c2d3e4f5a6b
  summary: Buy milk
  due: 2026-12-01
  status: needs-action
  ---
  The good kind

Only the directory's own files whose names end in .md are read, and those
whose names start with a dot are left out. A file with no front matter is
all body, and a file with no :uid takes its name, less the extension, as
its :uid. Front matter keys with no value are left out. Leading blank lines
and trailing whitespace aren't part of the body, and a blank body is no
:description.

A resource is identified by its :uid, and two files holding the same :uid
(as a synchronization tool's conflict copy would) make the directory
unreadable until one is removed. A resource's file is named after its
:summary, or its :uid when it has none, with characters that aren't
allowed in file names (or in Obsidian links) replaced with -. When another
file has that name, a number is added ("Buy milk 2.md"). The file is
renamed when its resource is saved with a :summary that gives another
name.

Each file is replaced atomically so that a reader never sees it half
written. The directory has no protection against several services or
processes writing it at the same time, so callers serialize their changes
and share one service per directory.

Failures throw an ex-info whose data has a :type of:

  ::invalid-config    The config map isn't a valid ::config
  ::invalid-resource  The resource can't be saved: it doesn't satisfy the
                      component's :spec, or it's being deleted without a
                      :uid
  ::invalid-file      A file can't be read as a resource, two files hold
                      the same :uid, or the path isn't a directory
raw docstring

dgknght.memos

Manage memos (VJOURNAL components, also called journal entries or notes) with one of multiple back ends. The Service protocol can be implemented as needed.

A memo is a plain map described by the ::memo spec:

:uid Non-blank string identifying the memo :summary String :description String: the memo's text :status :draft, :final or :cancelled :start The date or time the memo is for (DTSTART): java.time.LocalDate (all-day), LocalDateTime (floating), ZonedDateTime (local time in a time zone) or Instant (UTC) :created java.time.Instant :last-modified java.time.Instant :categories Set of non-blank strings: the memo's tags

The :extra-* keys hold iCalendar text for data the map doesn't model; see dgknght.memos.vjournal and dgknght.ical.

Manage memos (VJOURNAL components, also called journal entries or notes)
with one of multiple back ends. The Service protocol can be implemented as
needed.

A memo is a plain map described by the `::memo` spec:

  :uid            Non-blank string identifying the memo
  :summary        String
  :description    String: the memo's text
  :status         :draft, :final or :cancelled
  :start          The date or time the memo is for (DTSTART):
                  java.time.LocalDate (all-day), LocalDateTime (floating),
                  ZonedDateTime (local time in a time zone) or Instant (UTC)
  :created        java.time.Instant
  :last-modified  java.time.Instant
  :categories     Set of non-blank strings: the memo's tags

The `:extra-*` keys hold iCalendar text for data the map doesn't model; see
`dgknght.memos.vjournal` and `dgknght.ical`.
raw docstring

dgknght.memos.caldav

Store memos as VJOURNALs on a CalDAV server, through dgknght.caldav.

A service's config is a :dgknght.caldav/connection with a :dgknght.memos/provider of ::caldav. Its :calendar chooses among the calendars that can hold memos, which are often not the ones that hold tasks. Failures throw as described in dgknght.caldav.

Store memos as VJOURNALs on a CalDAV server, through `dgknght.caldav`.

A service's config is a `:dgknght.caldav/connection` with a
:dgknght.memos/provider of ::caldav. Its :calendar chooses among the
calendars that can hold memos, which are often not the ones that hold
tasks. Failures throw as described in `dgknght.caldav`.
raw docstring

dgknght.memos.json

Encode memos as data that can be written as JSON, and decode them again unchanged. Dates and times are ISO-8601 strings (see dgknght.json). Keywords (like :status) are strings and sets (like :categories) are arrays.

Encode memos as data that can be written as JSON, and decode them again
unchanged. Dates and times are ISO-8601 strings (see `dgknght.json`).
Keywords (like :status) are strings and sets (like :categories) are
arrays.
raw docstring

dgknght.memos.json-file

Keep memos in a single JSON file, through dgknght.json-file.

A service's config is a :dgknght.json-file/config with a :dgknght.memos/provider of ::json-file. The file holds a JSON array of memos, one object per memo with the keys of the :dgknght.memos/memo spec (other keys aren't saved), encoded as described in dgknght.memos.json.

Changes made through one service are serialized, but share one service per file. Failures throw as described in dgknght.json-file.

Keep memos in a single JSON file, through `dgknght.json-file`.

A service's config is a `:dgknght.json-file/config` with a
:dgknght.memos/provider of ::json-file. The file holds a JSON array of
memos, one object per memo with the keys of the `:dgknght.memos/memo` spec
(other keys aren't saved), encoded as described in `dgknght.memos.json`.

Changes made through one service are serialized, but share one service per
file. Failures throw as described in `dgknght.json-file`.
raw docstring

No vars found in this namespace.

dgknght.memos.logging

Log the calls made to a dgknght.memos/Service by wrapping it with wrap. Only the :uid and :url of a memo are logged, not its contents. Logging goes through clojure.tools.logging, under this namespace.

Requests sent to a CalDAV server are logged separately, at DEBUG under dgknght.tasks.http.

Log the calls made to a dgknght.memos/Service by wrapping it with `wrap`.
Only the :uid and :url of a memo are logged, not its contents. Logging goes
through clojure.tools.logging, under this namespace.

Requests sent to a CalDAV server are logged separately, at DEBUG under
dgknght.tasks.http.
raw docstring

dgknght.memos.markdown-dir

Keep memos in a directory of Markdown files, one per memo, through dgknght.markdown-dir.

A service's config is a :dgknght.markdown-dir/config with a :dgknght.memos/provider of ::markdown-dir. Each file holds a memo's :description (its text) as its body, after YAML front matter with the memo's other keys of the :dgknght.memos/memo spec (other keys aren't saved), encoded as described in dgknght.memos.json.

Changes made through one service are serialized, but share one service per directory. Failures throw as described in dgknght.markdown-dir.

Keep memos in a directory of Markdown files, one per memo, through
`dgknght.markdown-dir`.

A service's config is a `:dgknght.markdown-dir/config` with a
:dgknght.memos/provider of ::markdown-dir. Each file holds a memo's
:description (its text) as its body, after YAML front matter with the
memo's other keys of the `:dgknght.memos/memo` spec (other keys aren't
saved), encoded as described in `dgknght.memos.json`.

Changes made through one service are serialized, but share one service per
directory. Failures throw as described in `dgknght.markdown-dir`.
raw docstring

No vars found in this namespace.

dgknght.memos.vjournal

Convert between memo maps (the :dgknght.memos/memo spec) and iCalendar VJOURNAL components.

The DESCRIPTION becomes the memo's :description unless there's more than one, which RFC 5545 allows for a VJOURNAL but the memo map can't hold.

Properties that aren't modeled, such as a recurrence rule or a RELATED-TO, are kept as iCalendar text under :extra-properties. Other VJOURNALs in the calendar, such as an overridden occurrence, are kept under :extra-vjournals. Time zone definitions any of these need that can't be regenerated from the time zone database are kept under :extra-timezones. Serializing writes them back, so a parse/serialize round trip doesn't drop data written by other clients.

Convert between memo maps (the `:dgknght.memos/memo` spec) and iCalendar
VJOURNAL components.

The DESCRIPTION becomes the memo's :description unless there's more than
one, which RFC 5545 allows for a VJOURNAL but the memo map can't hold.

Properties that aren't modeled, such as a recurrence rule or a
RELATED-TO, are kept as iCalendar text under `:extra-properties`. Other
VJOURNALs in the calendar, such as an overridden occurrence, are kept under
`:extra-vjournals`. Time zone definitions any of these need that can't be
regenerated from the time zone database are kept under `:extra-timezones`.
Serializing writes them back, so a parse/serialize round trip doesn't drop
data written by other clients.
raw docstring

dgknght.tasks

Manage tasks (VTODO components) with one of multiple back ends. The Service protocol can be implemented as needed.

A task is a plain map described by the ::task spec:

:uid Non-blank string identifying the task :summary String :description String :status :needs-action, :in-process, :completed or :cancelled :start When the task starts (DTSTART), and its first occurrence if it recurs: a date or time, like :due :due java.time.LocalDate (all-day), LocalDateTime (floating), ZonedDateTime (local time in a time zone) or Instant (UTC) :priority Integer, 0 (undefined) and 1 (highest) through 9 (lowest) :completed java.time.Instant :created java.time.Instant :last-modified java.time.Instant :categories Set of non-blank strings: the task's tags :parent The :uid of the task this is a subtask of (RELATED-TO). Nothing cascades: deleting or completing a task leaves its subtasks as they are :recurrence The rule the task repeats by (RRULE): a map described in dgknght.tasks.recurrence :exdates Set of dates or times of occurrences skipped (EXDATE) :rdates Set of dates or times of extra occurrences (RDATE) :overrides Map of an occurrence's original date or time (its RECURRENCE-ID) to a task map that replaces it, e.g. one occurrence completed in Thunderbird. These have no :uid or recurrence keys of their own.

The :extra-* keys hold iCalendar text for data the map doesn't model; see dgknght.tasks.vtodo and dgknght.ical.

Manage tasks (VTODO components) with one of multiple back ends. The
Service protocol can be implemented as needed.

A task is a plain map described by the `::task` spec:

  :uid            Non-blank string identifying the task
  :summary        String
  :description    String
  :status         :needs-action, :in-process, :completed or :cancelled
  :start          When the task starts (DTSTART), and its first occurrence
                  if it recurs: a date or time, like :due
  :due            java.time.LocalDate (all-day), LocalDateTime (floating),
                  ZonedDateTime (local time in a time zone) or Instant (UTC)
  :priority       Integer, 0 (undefined) and 1 (highest) through 9 (lowest)
  :completed      java.time.Instant
  :created        java.time.Instant
  :last-modified  java.time.Instant
  :categories     Set of non-blank strings: the task's tags
  :parent         The :uid of the task this is a subtask of (RELATED-TO).
                  Nothing cascades: deleting or completing a task leaves
                  its subtasks as they are
  :recurrence     The rule the task repeats by (RRULE): a map described in
                  `dgknght.tasks.recurrence`
  :exdates        Set of dates or times of occurrences skipped (EXDATE)
  :rdates         Set of dates or times of extra occurrences (RDATE)
  :overrides      Map of an occurrence's original date or time (its
                  RECURRENCE-ID) to a task map that replaces it, e.g. one
                  occurrence completed in Thunderbird. These have no :uid
                  or recurrence keys of their own.

The `:extra-*` keys hold iCalendar text for data the map doesn't model; see
`dgknght.tasks.vtodo` and `dgknght.ical`.
raw docstring

dgknght.tasks.caldav

Store tasks as VTODOs on a CalDAV server, through dgknght.caldav.

A service's config is a :dgknght.caldav/connection with a :dgknght.tasks/provider of ::caldav. Failures throw as described in dgknght.caldav.

Store tasks as VTODOs on a CalDAV server, through `dgknght.caldav`.

A service's config is a `:dgknght.caldav/connection` with a
:dgknght.tasks/provider of ::caldav. Failures throw as described in
`dgknght.caldav`.
raw docstring

dgknght.tasks.http

Send HTTP requests, following redirects for any method.

A successful request returns a map of the response's :url (the one it finally came from, after redirects), :headers and :body. Anything else throws an ex-info whose data has the request's :url and a :type of:

::unreachable The server couldn't be reached ::unauthorized The server rejected the credentials (401) ::not-found Nothing is at the URL (404, 410) ::method-not-allowed The resource doesn't support the method (405) ::precondition-failed A conditional header didn't match (412) ::unexpected-response The server responded with something else

Except for ::unreachable, the data also has the response's :status and :body.

Each request sent, including each redirect followed, is logged at DEBUG with its method, URL, status and duration, but not its headers or body. Credentials are never logged.

Send HTTP requests, following redirects for any method.

A successful request returns a map of the response's :url (the one it
finally came from, after redirects), :headers and :body. Anything else
throws an ex-info whose data has the request's :url and a :type of:

  ::unreachable          The server couldn't be reached
  ::unauthorized         The server rejected the credentials (401)
  ::not-found            Nothing is at the URL (404, 410)
  ::method-not-allowed   The resource doesn't support the method (405)
  ::precondition-failed  A conditional header didn't match (412)
  ::unexpected-response  The server responded with something else

Except for ::unreachable, the data also has the response's :status and
:body.

Each request sent, including each redirect followed, is logged at DEBUG
with its method, URL, status and duration, but not its headers or body.
Credentials are never logged.
raw docstring

dgknght.tasks.json

Encode tasks as data that can be written as JSON, and decode them again unchanged. Dates and times are ISO-8601 strings (see dgknght.json). Keywords (like :status) are strings and sets (like :categories) are arrays.

Encode tasks as data that can be written as JSON, and decode them again
unchanged. Dates and times are ISO-8601 strings (see `dgknght.json`).
Keywords (like :status) are strings and sets (like :categories) are
arrays.
raw docstring

dgknght.tasks.json-file

Keep tasks in a single JSON file, through dgknght.json-file.

A service's config is a :dgknght.json-file/config with a :dgknght.tasks/provider of ::json-file. The file holds a JSON array of tasks, one object per task with the keys of the :dgknght.tasks/task spec (other keys aren't saved), encoded as described in dgknght.tasks.json.

Changes made through one service are serialized, but share one service per file. Failures throw as described in dgknght.json-file.

Keep tasks in a single JSON file, through `dgknght.json-file`.

A service's config is a `:dgknght.json-file/config` with a
:dgknght.tasks/provider of ::json-file. The file holds a JSON array of
tasks, one object per task with the keys of the `:dgknght.tasks/task` spec
(other keys aren't saved), encoded as described in `dgknght.tasks.json`.

Changes made through one service are serialized, but share one service per
file. Failures throw as described in `dgknght.json-file`.
raw docstring

No vars found in this namespace.

dgknght.tasks.logging

Log the calls made to a dgknght.tasks/Service by wrapping it with wrap. Only the :uid and :url of a task are logged, not its contents. Logging goes through clojure.tools.logging, under this namespace.

Requests sent to a CalDAV server are logged separately, at DEBUG under dgknght.tasks.http.

Log the calls made to a dgknght.tasks/Service by wrapping it with `wrap`.
Only the :uid and :url of a task are logged, not its contents. Logging goes
through clojure.tools.logging, under this namespace.

Requests sent to a CalDAV server are logged separately, at DEBUG under
dgknght.tasks.http.
raw docstring

dgknght.tasks.markdown-dir

Keep tasks in a directory of Markdown files, one per task, through dgknght.markdown-dir.

A service's config is a :dgknght.markdown-dir/config with a :dgknght.tasks/provider of ::markdown-dir. Each file holds a task's :description as its body, after YAML front matter with the task's other keys of the :dgknght.tasks/task spec (other keys aren't saved), encoded as described in dgknght.tasks.json.

Changes made through one service are serialized, but share one service per directory. Failures throw as described in dgknght.markdown-dir.

Keep tasks in a directory of Markdown files, one per task, through
`dgknght.markdown-dir`.

A service's config is a `:dgknght.markdown-dir/config` with a
:dgknght.tasks/provider of ::markdown-dir. Each file holds a task's
:description as its body, after YAML front matter with the task's other
keys of the `:dgknght.tasks/task` spec (other keys aren't saved), encoded
as described in `dgknght.tasks.json`.

Changes made through one service are serialized, but share one service per
directory. Failures throw as described in `dgknght.markdown-dir`.
raw docstring

No vars found in this namespace.

dgknght.tasks.recurrence

Recurring tasks: converting a recurrence rule between a map (the :dgknght.tasks/recurrence spec) and RRULE text, and listing a task's occurrences.

A rule is a map of:

:frequency :secondly, :minutely, :hourly, :daily, :weekly, :monthly or :yearly (required) :interval Positive integer :count Positive integer, the number of occurrences :until java.time.LocalDate, LocalDateTime or Instant, the last possible occurrence (not with :count) :by-day Vector of weekdays, each :su, :mo, :tu, :we, :th, :fr or :sa, or [n weekday] for the nth one, e.g. [-1 :fr] for the last Friday :by-month Vector of months, 1-12 :by-month-day Vector of days of the month, 1-31 or -31 to -1 :by-year-day Vector of days of the year, 1-366 or -366 to -1 :by-week-no Vector of weeks of the year, 1-53 or -53 to -1 :by-hour Vector of hours, 0-23 :by-minute Vector of minutes, 0-59 :by-second Vector of seconds, 0-60 :by-set-pos Vector of positions within the set, 1-366 or -366 to -1 :week-start The weekday weeks start on

Recurring tasks: converting a recurrence rule between a map (the
`:dgknght.tasks/recurrence` spec) and RRULE text, and listing a task's
occurrences.

A rule is a map of:

  :frequency     :secondly, :minutely, :hourly, :daily, :weekly, :monthly
                 or :yearly (required)
  :interval      Positive integer
  :count         Positive integer, the number of occurrences
  :until         java.time.LocalDate, LocalDateTime or Instant, the last
                 possible occurrence (not with :count)
  :by-day        Vector of weekdays, each :su, :mo, :tu, :we, :th, :fr or
                 :sa, or [n weekday] for the nth one, e.g. [-1 :fr] for
                 the last Friday
  :by-month      Vector of months, 1-12
  :by-month-day  Vector of days of the month, 1-31 or -31 to -1
  :by-year-day   Vector of days of the year, 1-366 or -366 to -1
  :by-week-no    Vector of weeks of the year, 1-53 or -53 to -1
  :by-hour       Vector of hours, 0-23
  :by-minute     Vector of minutes, 0-59
  :by-second     Vector of seconds, 0-60
  :by-set-pos    Vector of positions within the set, 1-366 or -366 to -1
  :week-start    The weekday weeks start on
raw docstring

dgknght.tasks.sync

Keep two task services in step, e.g. a JSON file used offline (the local service) and a CalDAV calendar (the remote one), with synchronize.

Tasks are matched by their :uid. What changed on each side since the last sync is found by comparing it with the base: each task as it was when the two sides last agreed, along with each side's :etag for it where the provider has one. A task's :url and :etag are the provider's, not part of its content, and aren't copied from one side to the other.

The base belongs to the pair of services, so synchronize takes it and returns the new one, and the app keeps it wherever it likes, written out with serialize-base and read back with parse-base.

Failures throw an ex-info whose data has a :type of:

::invalid-options The options map isn't valid ::wrong-base The base was made for a different pair of services ::invalid-base The base can't be parsed

Keep two task services in step, e.g. a JSON file used offline (the local
service) and a CalDAV calendar (the remote one), with `synchronize`.

Tasks are matched by their :uid. What changed on each side since the last
sync is found by comparing it with the base: each task as it was when the
two sides last agreed, along with each side's :etag for it where the
provider has one. A task's :url and :etag are the provider's, not part of
its content, and aren't copied from one side to the other.

The base belongs to the pair of services, so `synchronize` takes it and
returns the new one, and the app keeps it wherever it likes, written out
with `serialize-base` and read back with `parse-base`.

Failures throw an ex-info whose data has a :type of:

  ::invalid-options  The options map isn't valid
  ::wrong-base       The base was made for a different pair of services
  ::invalid-base     The base can't be parsed
raw docstring

dgknght.tasks.vtodo

Convert between task maps (the :dgknght.tasks/task spec) and iCalendar VTODO components.

The overridden occurrences of a recurring task (VTODOs with its UID and a RECURRENCE-ID) become its :overrides.

A RELATED-TO naming the task's parent (RELTYPE=PARENT, the default) becomes its :parent, unless there's more than one or it has other parameters. Other relationships stay in :extra-properties.

Properties and subcomponents (e.g. VALARM) that aren't modeled are kept as iCalendar text under :extra-properties and :extra-components, as is a recurrence rule with parts the rule map doesn't model and an RDATE of periods. Other VTODOs in the calendar, such as an override of this and future occurrences (RANGE=THISANDFUTURE), are kept under :extra-vtodos. Time zone definitions any of these need that can't be regenerated from the time zone database are kept under :extra-timezones. Serializing writes them back, so a parse/serialize round trip doesn't drop data written by other clients.

Convert between task maps (the `:dgknght.tasks/task` spec) and iCalendar
VTODO components.

The overridden occurrences of a recurring task (VTODOs with its UID and a
RECURRENCE-ID) become its `:overrides`.

A RELATED-TO naming the task's parent (RELTYPE=PARENT, the default) becomes
its `:parent`, unless there's more than one or it has other parameters.
Other relationships stay in `:extra-properties`.

Properties and subcomponents (e.g. VALARM) that aren't modeled are kept as
iCalendar text under `:extra-properties` and `:extra-components`, as is a
recurrence rule with parts the rule map doesn't model and an RDATE of
periods. Other VTODOs in the calendar, such as an override of this and
future occurrences (RANGE=THISANDFUTURE), are kept under `:extra-vtodos`.
Time zone
definitions any of these need that can't be regenerated from the time zone
database are kept under `:extra-timezones`. Serializing writes them back, so
a parse/serialize round trip doesn't drop data written by other clients.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close