Extensions

- Clarification in the extensions document.
This commit is contained in:
Paul Beckingham 2011-04-24 12:40:50 -04:00
parent 86ef048cb0
commit a7c3858729
3 changed files with 22 additions and 3 deletions

View file

@ -35,6 +35,8 @@
+ Added feature #714, including Belarus holidays (thanks to Alexei Romanoff). + Added feature #714, including Belarus holidays (thanks to Alexei Romanoff).
# Tracked Bugs, sorted by ID. # Tracked Bugs, sorted by ID.
+ Fixed bug #594, which broke the 'all' report with a combination of bad regex
handling and a formatting bug (thanks to Steve Rader).
+ Fixed bug #605, which gave misleading project completion percentages under + Fixed bug #605, which gave misleading project completion percentages under
certain circumstances (thanks to Steve Rader). certain circumstances (thanks to Steve Rader).
+ Fixed bug #703, where global substitutions didn't make all expected + Fixed bug #703, where global substitutions didn't make all expected

View file

@ -7,8 +7,8 @@ invoked have access to taskwarrior internals through a Lua API.
There are several types of extension. Each type has different requirements, and There are several types of extension. Each type has different requirements, and
is called in different ways. is called in different ways.
All extensions must be installed, which means they must implement the 'install' All extensions must be installed using the 'install' command, which means they
function, which provides: must implement the 'install' function, which returns a set of string values for:
- Type One of: program, task, uda, command, format, dom - Type One of: program, task, uda, command, format, dom
- Name Single word name - Name Single word name
@ -19,6 +19,11 @@ function, which provides:
- License Distribution License - License Distribution License
- Copyright Copyright notice - Copyright Copyright notice
All extensions, on installation, will be copied into ~/.task/extensions, and the
corresponding configuration entry will be created:
extension.<uuid>=<JSON description block>
Program Hooks Program Hooks
------------- -------------
@ -63,6 +68,7 @@ extensions must provide:
- Custom types must implement a compare function for sorting - Custom types must implement a compare function for sorting
- Default format rendering - Default format rendering
- Allowed value checking - Allowed value checking
- Urgency calculation term
Command Command
@ -75,7 +81,7 @@ provide:
- Declaration as read-only or write command, which allows taskwarrior to - Declaration as read-only or write command, which allows taskwarrior to
allow this command when the database is read-only allow this command when the database is read-only
- Declaration of whether the command displays ID values, which instructs - Declaration of whether the command displays ID values, which instructs
taskwarrior to run a GC beforehan taskwarrior to run a GC beforehand
Format Format

View file

@ -59,3 +59,14 @@ function format (value)
return value return value
end end
-- Arguments: Value
-- Returns: Urgency Term
-- Note: Should reference rc.urgency.<field>.coefficient
function urgency (value)
coefficient = task_get ('urgency.<field>.coefficient')
-- TODO Urgency calculation here
return coefficient * 1.0
end