gopher.nvim/scripts/docgen.lua
Smirnov Oleksandr 7e33602065
refactor/comamnds dont require .setup (#101)
* refactor(commands)!: change the way of disabling commands

BREAKING CHANGE: not it does not require calling .setup()

* docs: update docs
2025-03-22 17:06:57 +02:00

33 lines
836 B
Lua

---@diagnostic disable: undefined-global
--# selene: allow(undefined_variable)
local okay, minidoc = pcall(require, "mini.doc")
if not okay then
error "mini.doc not found, please install it. https://github.com/echasnovski/mini.doc"
return
end
local files = {
"lua/gopher/init.lua",
"lua/gopher/config.lua",
"plugin/gopher.lua",
"lua/gopher/struct_tags.lua",
"lua/gopher/impl.lua",
"lua/gopher/gotests.lua",
"lua/gopher/iferr.lua",
"lua/gopher/comment.lua",
}
minidoc.setup()
local hooks = vim.deepcopy(minidoc.default_hooks)
hooks.write_pre = function(lines)
-- Remove first two lines with `======` and `------` delimiters to comply
-- with `:h local-additions` template
table.remove(lines, 1)
table.remove(lines, 1)
return lines
end
MiniDoc.generate(files, "doc/gopher.nvim.txt", { hooks = hooks })