feat: add docs generator

This commit is contained in:
Smirnov Oleksandr 2024-02-28 19:44:24 +02:00
parent 8badd8e63d
commit 6772d0560b
2 changed files with 28 additions and 1 deletions

View file

@ -37,3 +37,13 @@ tasks:
{minimal_init='./scripts/minimal_init.lua' \ {minimal_init='./scripts/minimal_init.lua' \
,sequential=true}" \ ,sequential=true}" \
-c ":qa!" -c ":qa!"
docgen:
desc: generate vimhelp
cmds:
- |
nvim --noplugin \
--headless \
-u "./scripts/minimal_init.lua" \
-c "luafile ./scripts/doc_gen.lua" \
-c "qa!"

View file

@ -7,6 +7,23 @@ if not okay then
return return
end end
local files = {
"lua/gopher/init.lua",
"lua/gopher/config.lua",
}
minidoc.setup() minidoc.setup()
MiniDoc.generate({ "lua/gopher" }, "doc/gopher.nvim.txt") 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
print "Generating documentation...\n"
MiniDoc.generate(files, "doc/gopher.nvim.txt", { hooks = hooks })
print "Generation complete!\n"