zettelkasten.nvim/lua/zettelkasten/init.lua
Marty Oehme d29d92cc0a
Remove hardcoded options, do repo house-cleaning
Update readme and tmux.session file.

Remove unused tests, update option calling.
2020-11-04 22:27:30 +01:00

27 lines
828 B
Lua

local ZK = {}
local ls = require 'zettelkasten.list'
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, ZK.options)
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
}