mirror of https://github.com/folke/lazy.nvim.git
feat(help): allow disabling README magic (#663)
This commit is contained in:
parent
b3eca0c3fb
commit
e5759d202a
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue