refactor(scripts): rename doc-gen script

This commit is contained in:
Smirnov Oleksandr 2024-04-02 16:59:39 +03:00
parent e601ce75ab
commit 1969241122
2 changed files with 2 additions and 1 deletions

28
scripts/docgen.lua Normal file
View file

@ -0,0 +1,28 @@
---@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",
"lua/gopher/impl.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 })