From 2affb8373f3f52ff3dba45508ff0fe4e6d1eda6b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 26 Aug 2025 19:33:16 -0400 Subject: docs: api events --- src/gen/gen_vimdoc.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/gen/gen_vimdoc.lua') 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', -- cgit