Marty Oehme
9dcd2556ba
Renamed to 'files.lua' since it is the only module actively working on the underlying filesystem so far -- gathering existing files and zettel in the directories.
27 lines
817 B
Lua
27 lines
817 B
Lua
local ZK = {}
|
|
|
|
local ls = require 'zettelkasten.files'
|
|
local o = require 'zettelkasten.options'
|
|
local anchor = require 'zettelkasten.anchor'
|
|
local action = require 'zettelkasten.action'
|
|
|
|
-- 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)
|
|
return ls.get_anchors_and_paths(path, recursive or false)
|
|
end
|
|
|
|
-- Return a valid zettelkasten anchor for the current time,
|
|
-- composed of yymmddHHMM.
|
|
function ZK.get_anchor() return anchor.create() end
|
|
|
|
-- Open link under cursor, or next on line
|
|
function ZK.open_link() return action.open_selected() end
|
|
|
|
return {
|
|
get_zettel_list = ZK.get_zettel_list,
|
|
get_anchor = ZK.get_anchor,
|
|
open_link = ZK.open_link
|
|
}
|