fix(docs): auto-gen of readme stuff

This commit is contained in:
Folke Lemaitre 2023-01-09 08:05:46 +01:00
parent a32e307981
commit 3a216d008d
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ function M.save(contents)
if not readme:find(pattern) then if not readme:find(pattern) then
error("tag " .. tag .. " not found") error("tag " .. tag .. " not found")
end end
if tag == "commands" or tag == "colors" or tag == "plugins" then if tag == "commands" or tag == "colors" or tag == "plugins" or tag == "keymaps" then
readme = readme:gsub(pattern, "%1\n\n" .. content .. "\n\n%2") readme = readme:gsub(pattern, "%1\n\n" .. content .. "\n\n%2")
else else
readme = readme:gsub(pattern, "%1\n\n```lua\n" .. content .. "\n```\n\n%2") readme = readme:gsub(pattern, "%1\n\n```lua\n" .. content .. "\n```\n\n%2")
@ -137,7 +137,7 @@ end
function M.plugins() function M.plugins()
local Config = require("lazy.core.config") local Config = require("lazy.core.config")
local lines = { "## Plugins", "" } local lines = {}
Util.foreach(Config.plugins, function(name, plugin) Util.foreach(Config.plugins, function(name, plugin)
if plugin.url then if plugin.url then
lines[#lines + 1] = "- [" .. name .. "](" .. plugin.url:gsub("%.git$", "") .. ")" lines[#lines + 1] = "- [" .. name .. "](" .. plugin.url:gsub("%.git$", "") .. ")"