2020-10-26 14:55:40 +00:00
|
|
|
local ZK = {}
|
2020-10-26 18:32:27 +00:00
|
|
|
|
2020-10-29 18:00:23 +00:00
|
|
|
local ls = require 'zettelkasten.list'
|
2020-10-30 15:04:23 +00:00
|
|
|
local o = require 'zettelkasten.options'
|
2020-10-30 15:30:37 +00:00
|
|
|
local a = require 'zettelkasten.anchor'
|
2020-10-26 14:55:40 +00:00
|
|
|
|
2020-10-29 11:18:19 +00:00
|
|
|
-- Returns all zettel in path as a
|
|
|
|
-- { "anchor" = "path/to/zettel/anchor filename.md" }
|
|
|
|
-- table.
|
|
|
|
-- Recurses into subdirectories if recursive argument is true.
|
|
|
|
function ZK.get_zettel_list(path, recursive)
|
2020-10-29 18:09:13 +00:00
|
|
|
return ls.get_anchors_and_paths(path, recursive or false, ZK.options)
|
2020-10-29 11:18:19 +00:00
|
|
|
end
|
|
|
|
|
2020-10-31 10:01:53 +00:00
|
|
|
-- Return a valid zettelkasten anchor for the current time,
|
|
|
|
-- composed of yymmddHHMM.
|
|
|
|
function ZK.create_anchor() return a.create() end
|
2020-10-30 15:30:37 +00:00
|
|
|
|
2020-10-31 13:17:26 +00:00
|
|
|
return {get_zettel_list = ZK.get_zettel_list, create_anchor = ZK.create_anchor}
|