15 lines
364 B
Lua
15 lines
364 B
Lua
local M = {}
|
|
|
|
function M.imp(ft, template, name)
|
|
ft, template, name = ft or "", template or "", name or ""
|
|
if ft == "" or template == "" or name == "" then
|
|
return
|
|
end
|
|
local ok, mod = pcall(require, "vern.templates." .. ft)
|
|
if ok and type(mod) ~= "table" then
|
|
return string.gsub(mod[template], "%%s", name)
|
|
end
|
|
end
|
|
|
|
return M
|