feat: add docs generator
This commit is contained in:
parent
8badd8e63d
commit
6772d0560b
2 changed files with 28 additions and 1 deletions
10
Taskfile.yml
10
Taskfile.yml
|
|
@ -37,3 +37,13 @@ tasks:
|
|||
{minimal_init='./scripts/minimal_init.lua' \
|
||||
,sequential=true}" \
|
||||
-c ":qa!"
|
||||
|
||||
docgen:
|
||||
desc: generate vimhelp
|
||||
cmds:
|
||||
- |
|
||||
nvim --noplugin \
|
||||
--headless \
|
||||
-u "./scripts/minimal_init.lua" \
|
||||
-c "luafile ./scripts/doc_gen.lua" \
|
||||
-c "qa!"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,23 @@ if not okay then
|
|||
return
|
||||
end
|
||||
|
||||
local files = {
|
||||
"lua/gopher/init.lua",
|
||||
"lua/gopher/config.lua",
|
||||
}
|
||||
|
||||
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue