aboutsummaryrefslogtreecommitdiff
path: root/src/gen/gen_vimdoc.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-08-26 19:33:16 -0400
committerJustin M. Keyes <justinkz@gmail.com>2025-09-04 00:11:52 -0400
commit2affb8373f3f52ff3dba45508ff0fe4e6d1eda6b (patch)
tree259a32ab5bc10a7641d5129e74b55ce0a0272563 /src/gen/gen_vimdoc.lua
parent9c3099f0cf0d1e9aa4edba13c5b5f6d3575aa18d (diff)
downloadrneovim-2affb8373f3f52ff3dba45508ff0fe4e6d1eda6b.tar.gz
rneovim-2affb8373f3f52ff3dba45508ff0fe4e6d1eda6b.tar.bz2
rneovim-2affb8373f3f52ff3dba45508ff0fe4e6d1eda6b.zip
docs: api events
Diffstat (limited to 'src/gen/gen_vimdoc.lua')
-rwxr-xr-xsrc/gen/gen_vimdoc.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gen/gen_vimdoc.lua b/src/gen/gen_vimdoc.lua
index ba96008cef..0450c46f62 100755
--- a/src/gen/gen_vimdoc.lua
+++ b/src/gen/gen_vimdoc.lua
@@ -1,5 +1,8 @@
#!/usr/bin/env -S nvim -l
---- Generates Nvim :help docs from Lua/C docstrings
+--- Generates Nvim :help docs from Lua/C docstrings.
+---
+--- Usage:
+--- make doc
---
--- The generated :help text for each function is formatted as follows:
--- - Max width of 78 columns (`TEXT_WIDTH`).
@@ -106,6 +109,7 @@ local config = {
filename = 'api.txt',
section_order = {
-- Sections at the top, in a specific order:
+ 'events.c',
'vim.c',
'vimscript.c',
@@ -126,11 +130,22 @@ local config = {
['vim.c'] = 'Global',
},
section_fmt = function(name)
+ if name == 'Events' then
+ return 'Global Events'
+ end
+
return name .. ' Functions'
end,
helptag_fmt = function(name)
return fmt('api-%s', name:lower())
end,
+ fn_helptag_fmt = function(fun)
+ local name = fun.name
+ if vim.endswith(name, '_event') then
+ return name
+ end
+ return fn_helptag_fmt_common(fun)
+ end,
},
lua = {
filename = 'lua.txt',