fix: vimdoc

This commit is contained in:
Folke Lemaitre 2024-06-23 19:49:03 +02:00
parent 720bc15a52
commit f6a98dbd81
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
3 changed files with 969 additions and 35 deletions

974
README.md

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,13 @@ sidebar_position: 5
{
root = vim.fn.stdpath("data") .. "/lazy", -- directory where plugins will be installed
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false, -- should plugins be lazy-loaded?
version = nil,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = nil, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
-- default `cond` you can use to globally disable a lot of plugins
-- when running inside vscode for example
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil

View File

@ -118,11 +118,26 @@ function M.readme()
end
return aa < bb
end)
local lines = {}
local text = ""
for _, md in ipairs(mds) do
table.insert(lines, ("```{.include}\n%s\n```"):format(md))
local t = Util.read_file(md) .. "\n\n"
-- remove frontmatter
t = t:gsub("^%-%-%-.-%-%-%-\n", "")
-- remove code block titles
t = t:gsub("```lua.-\n", "```lua\n")
-- remove markdown comments
t = t:gsub("<!--.-\n", "")
-- remove <Tabs>
t = t:gsub("</?Tabs>", "")
-- replace tab item with ## title
-- <TabItem value="multiple" label="Structured Setup">
t = t:gsub('[ \t]*<TabItem value="([^"]+)" label="([^"]+)">', "## %2")
t = t:gsub("</?TabItem>", "")
t = t:gsub("\n%s*\n", "\n\n")
text = text .. t
end
Util.write_file("README.md", vim.trim(table.concat(lines, "\n\n")))
text = vim.trim(text)
Util.write_file("README.md", text)
end
function M.update()