Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7e815f0

Browse files
feat(api): Add more options for agenda
1 parent e3e8204 commit 7e815f0

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

lua/orgmode/api/agenda.lua

+17-12
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,37 @@ local function get_opts(options)
2727
opts.filter = options.filters
2828
end
2929
opts.header = options.header
30+
opts.agenda_files = options.org_agenda_files
31+
opts.sorting_strategy = options.org_agenda_sorting_strategy
32+
opts.tag_filter = options.org_agenda_tag_filter_preset
33+
opts.category_filter = options.org_agenda_category_filter_preset
34+
opts.remove_tags = options.org_agenda_remove_tags
3035
return opts
3136
end
3237

33-
---@class OrgApiAgendaOptions
38+
---@class OrgApiAgendaOpts
3439
---@field filters? OrgApiAgendaFilter
40+
---@field header? string
41+
---@field org_agenda_files? string[]
42+
---@field org_agenda_tag_filter_preset? string
43+
---@field org_agenda_category_filter_preset? string
44+
---@field org_agenda_sorting_strategy? OrgAgendaSortingStrategy[]
45+
---@field org_agenda_remove_tags? boolean
46+
47+
---@class OrgApiAgendaOptions:OrgApiAgendaOpts
3548
---@field from? string | OrgDate
3649
---@field span? OrgAgendaSpan
37-
---@field header? string
3850

3951
---@param options? OrgApiAgendaOptions
4052
function OrgAgenda.agenda(options)
4153
options = options or {}
4254
local opts = get_opts(options)
4355
opts.from = get_date(options.from, 'from')
4456
opts.span = options.span
45-
opts.header = options.header
4657
orgmode.agenda:agenda(opts)
4758
end
4859

49-
---@class OrgApiAgendaTodosOptions
50-
---@field filters? OrgApiAgendaFilter
51-
---@field header? string
60+
---@class OrgApiAgendaTodosOptions:OrgApiAgendaOpts
5261

5362
---@param options? OrgApiAgendaTodosOptions
5463
function OrgAgenda.todos(options)
@@ -57,11 +66,9 @@ function OrgAgenda.todos(options)
5766
orgmode.agenda:todos(opts)
5867
end
5968

60-
---@class OrgApiAgendaTagsOptions
61-
---@field filters? OrgApiAgendaFilter Agenda filters for tags and categories
69+
---@class OrgApiAgendaTagsOptions:OrgApiAgendaOpts
6270
---@field match_query? string Match query to find the todos
6371
---@field todo_only? boolean
64-
---@field header? string
6572

6673
---@param options? OrgApiAgendaTagsOptions
6774
function OrgAgenda.tags(options)
@@ -72,10 +79,8 @@ function OrgAgenda.tags(options)
7279
orgmode.agenda:tags(opts)
7380
end
7481

75-
---@class OrgApiAgendaTagsTodoOptions
76-
---@field filters? OrgApiAgendaFilter Agenda filters for tags and categories
82+
---@class OrgApiAgendaTagsTodoOptions:OrgApiAgendaOpts
7783
---@field match_query? string Match query to find the todos
78-
---@field header? string
7984

8085
---@param options? OrgApiAgendaTagsOptions
8186
function OrgAgenda.tags_todo(options)

0 commit comments

Comments
 (0)