From 49c1e9d1fc3d6bf8748756a8543d8c1b7287940f Mon Sep 17 00:00:00 2001 From: moxie Date: Sun, 15 Mar 2026 06:41:37 +0200 Subject: refactor: move template/mkdir features to user-configured autocmds - Remove auto-mkdir autocmd from init.lua (now user-configured) - Remove template system entirely (now user-configured) - Rename io.lua -> utils.lua - Inline single-use functions (handle_web_link, handle_file_link, etc.) - Remove security warnings for external files - Remove unused config options: use_template, template, date_fmt - Simplify utils.resolve() without wiki root validation - Update all documentation examples BREAKING CHANGE: Users must now add their own autocmds for: - Auto-creating directories on save (BufWritePre) - Applying templates to new files (BufNewFile) See README.md for updated configuration examples. --- lua/muwiki/external.lua | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'lua/muwiki/external.lua') diff --git a/lua/muwiki/external.lua b/lua/muwiki/external.lua index cf26aca..9ea83b5 100644 --- a/lua/muwiki/external.lua +++ b/lua/muwiki/external.lua @@ -27,33 +27,4 @@ function M.execute(handler, url) end end -function M.matches(handler, url) - local pattern = handler.pattern - - if pattern == nil then - return true - end - - if type(pattern) == 'string' then - return url:match(pattern) ~= nil - end - - for _, p in ipairs(pattern) do - if url:match(p) then - return true - end - end - return false -end - -function M.get_matching(url) - local matching = {} - for _, handler in ipairs(config.options.external_handlers) do - if M.matches(handler, url) then - table.insert(matching, handler) - end - end - return matching -end - return M -- cgit v1.2.3