I want the option to not only be function, but also string. So the config can be like this:
require'clipboard-image'.setup {
img_dir = 'src/assets/img',
img_dir_txt = '/assets/img',
img_name = function ()
local img_dir = require'clipboard-image'.get_config().img_dir()
local index = 1
for output in io.popen('ls '..img_dir):lines() do
if output == 'image'..index..'.png' then
index = index + 1
else
break
end
end
return 'image'..index
end,
prefix = '![](',
suffix = ')'
}
I want the option to not only be function, but also string. So the config can be like this: