feat(help): allow disabling README magic (#663)

This commit is contained in:
abal 2023-03-17 08:18:02 -07:00 committed by GitHub
parent b3eca0c3fb
commit e5759d202a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -435,6 +435,7 @@ return {
-- so :help works even for plugins that don't have vim docs. -- so :help works even for plugins that don't have vim docs.
-- when the readme opens with :help it will be correctly displayed as markdown -- when the readme opens with :help it will be correctly displayed as markdown
readme = { readme = {
enabled = true,
root = vim.fn.stdpath("state") .. "/lazy/readme", root = vim.fn.stdpath("state") .. "/lazy/readme",
files = { "README.md", "lua/**/README.md" }, files = { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docs -- only generate markdown helptags for plugins that dont have docs

View File

@ -141,6 +141,7 @@ M.defaults = {
-- so :help works even for plugins that don't have vim docs. -- so :help works even for plugins that don't have vim docs.
-- when the readme opens with :help it will be correctly displayed as markdown -- when the readme opens with :help it will be correctly displayed as markdown
readme = { readme = {
enabled = true,
root = vim.fn.stdpath("state") .. "/lazy/readme", root = vim.fn.stdpath("state") .. "/lazy/readme",
files = { "README.md", "lua/**/README.md" }, files = { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docs -- only generate markdown helptags for plugins that dont have docs

View File

@ -41,6 +41,10 @@ function M.update()
if Config.plugins["lazy.nvim"] then if Config.plugins["lazy.nvim"] then
vim.cmd.helptags(Config.plugins["lazy.nvim"].dir .. "/doc") vim.cmd.helptags(Config.plugins["lazy.nvim"].dir .. "/doc")
end end
if Config.options.readme.enabled == false then
return
end
local docs = Config.options.readme.root .. "/doc" local docs = Config.options.readme.root .. "/doc"
vim.fn.mkdir(docs, "p") vim.fn.mkdir(docs, "p")