Skip to content

Commit

Permalink
feat(help): allow disabling README magic (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
abalabahaha committed Mar 17, 2023
1 parent b3eca0c commit e5759d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ return {
-- 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
readme = {
enabled = true,
root = vim.fn.stdpath("state") .. "/lazy/readme",
files = { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docs
Expand Down
1 change: 1 addition & 0 deletions lua/lazy/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ M.defaults = {
-- 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
readme = {
enabled = true,
root = vim.fn.stdpath("state") .. "/lazy/readme",
files = { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docs
Expand Down
4 changes: 4 additions & 0 deletions lua/lazy/help.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function M.update()
if Config.plugins["lazy.nvim"] then
vim.cmd.helptags(Config.plugins["lazy.nvim"].dir .. "/doc")
end
if Config.options.readme.enabled == false then
return
end

local docs = Config.options.readme.root .. "/doc"
vim.fn.mkdir(docs, "p")

Expand Down

0 comments on commit e5759d2

Please sign in to comment.