[mirror] Make your go dev experience better
github.com/olexsmir/gopher.nvim
neovim
golang
1---@diagnostic disable: undefined-global
2--# selene: allow(undefined_variable)
3
4local okay, minidoc = pcall(require, "mini.doc")
5if not okay then
6 error "mini.doc not found, please install it. https://github.com/echasnovski/mini.doc"
7 return
8end
9
10local files = {
11 "lua/gopher/init.lua",
12 "lua/gopher/config.lua",
13 "lua/gopher/struct_tags.lua",
14 "lua/gopher/impl.lua",
15 "lua/gopher/gotests.lua",
16 "lua/gopher/iferr.lua",
17 "lua/gopher/comment.lua",
18}
19
20minidoc.setup()
21
22local hooks = vim.deepcopy(minidoc.default_hooks)
23hooks.write_pre = function(lines)
24 -- Remove first two lines with `======` and `------` delimiters to comply
25 -- with `:h local-additions` template
26 table.remove(lines, 1)
27 table.remove(lines, 1)
28
29 return lines
30end
31
32MiniDoc.generate(files, "doc/gopher.nvim.txt", { hooks = hooks })