PYTHON: Project setup fixed and working, just need to add providers
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
local M = {}
|
||||
|
||||
function M.imp(ft, template, name)
|
||||
---@param ft string Filetype of template
|
||||
---@param template string Template in language table
|
||||
---@param name string A string to replace temp values in template
|
||||
---@return string
|
||||
function M.fetch(ft, template, name)
|
||||
ft, template, name = ft or "", template or "", name or ""
|
||||
if ft == "" or template == "" or name == "" then
|
||||
return
|
||||
return ""
|
||||
end
|
||||
local ok, mod = pcall(require, "vern.templates." .. ft)
|
||||
if ok and type(mod) ~= "table" then
|
||||
return string.gsub(mod[template], "%%s", name)
|
||||
if ok and type(mod) == "table" then
|
||||
return (string.gsub(mod[template], "%%s", name))
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user