]>
Commit | Line | Data |
---|---|---|
56292c79 RBR |
1 | local defaults = { |
2 | nota_home = '~/.local/share/nota', -- Root location in which to store all notes | |
3 | default_keybinds = true, -- Whether or not to set the default keybinds | |
4 | periodic_locations = { | |
5 | daily = 'periodic/daily', -- Location to store daily notes, relative to nota_home | |
6 | weekly = 'periodic/weekly', -- Location to store weekly notes, relative to nota_home | |
7 | monthly = 'periodic/monthly', -- Location to store monthly notes, relative to nota_home | |
8 | seasonal = 'periodic/seasonal', -- Location to store seasonal notes, relative to nota_home | |
9 | yearly = 'periodic/yearly' -- Location to store yearly notes, relative to nota_home | |
10 | }, | |
11 | templates = { | |
12 | daily = 'templates/daily.md', -- Template for daily notes, relative to nota_home | |
13 | weekly = 'templates/weekly.md', -- Template for weekly notes, relative to nota_home | |
14 | monthly = 'templates/monthly.md', -- Template for monthly notes, relative to nota_home | |
15 | seasonal = 'templates/seasonal.md', -- Template for seasonal notes, relative to nota_home | |
16 | yearly = 'templates/yearly.md', -- Template for yearly notes, relative to nota_home | |
17 | plan = 'templates/plan.md' -- Template for plan notes, relative to nota_home | |
18 | }, | |
19 | tasks = { | |
20 | inbox = 'inbox.md', -- Location of the file in which to store newly captured tasks, relative to nota_home | |
21 | someday = 'someday.md' -- Location of the file in which to store indefinitely deferred tasks, relative to nota_home | |
22 | }, | |
23 | learning = { | |
24 | learning_file = 'learning.md', -- Location of the file in which to store learning entries, relative to nota_home | |
25 | prefix = '%Y-%x-%d: ' -- Prefix to add when capturing learning entries | |
26 | }, | |
27 | plan = { | |
28 | archive = 'plans', -- Location of the plan archives. | |
29 | plan_file = '~/.plan' -- Location of the active plan, the default is what is expected by finger. | |
30 | } | |
31 | } | |
32 | ||
33 | -- Recursively extends a table with another | |
34 | local function extend(target, extender) | |
35 | for key, value in pairs(extender) do | |
36 | if type(target[key]) == "table" and type(value) == "table" then | |
37 | extend(target[key], value) | |
38 | else | |
39 | target[key] = value | |
40 | end | |
41 | end | |
42 | end | |
43 | ||
44 | function configure(user_configuration) | |
45 | return extend(defaults, extender) | |
46 | end |