2020-10-30 15:04:23 +00:00
|
|
|
local Opt = {}
|
|
|
|
|
|
|
|
-- setting defaults
|
|
|
|
local ZETTEL_EXTENSION = ".md"
|
2020-10-30 17:44:50 +00:00
|
|
|
local ZETTEL_LINK_STYLE = "markdown"
|
2020-10-30 15:04:23 +00:00
|
|
|
local ANCHOR_SEPARATOR = "_"
|
|
|
|
-- TODO zettel_root = vim.g["zettel_root"] or vim.b["zettel_root"] or "~/documents/notes",
|
|
|
|
-- TODO zettel_anchor_pattern = regex? -> needs custom creation function in `create_anchor`
|
|
|
|
|
|
|
|
function Opt.zettel()
|
|
|
|
local options = {}
|
|
|
|
options.extension =
|
|
|
|
vim.g["zettel_extension"] or vim.b["zettel_extension"] or
|
|
|
|
ZETTEL_EXTENSION
|
2020-10-30 17:44:50 +00:00
|
|
|
options.link_style = vim.g["zettel_link_style"] or
|
|
|
|
vim.b["zettel_link_style"] or ZETTEL_LINK_STYLE
|
|
|
|
|
|
|
|
if options.link_style ~= "wiki" and options.link_style ~= "markdown" then
|
|
|
|
error("zettel_link_style can only be set to markdown or wiki.")
|
|
|
|
end
|
2020-10-30 15:04:23 +00:00
|
|
|
return options
|
|
|
|
end
|
|
|
|
|
|
|
|
function Opt.anchor()
|
|
|
|
local options = {}
|
|
|
|
options.separator = vim.g["zettel_anchor_separator"] or
|
|
|
|
vim.b["zettel_anchor_separator"] or ANCHOR_SEPARATOR
|
|
|
|
return options
|
|
|
|
end
|
|
|
|
|
|
|
|
return Opt
|