diff options
| author | Albert Krewinkel <[email protected]> | 2024-06-07 18:21:46 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2024-06-07 20:36:29 +0200 |
| commit | bfb0475d677bd5e7a61629107d99f2371a75e2d1 (patch) | |
| tree | a480786b8436f58613c218adac3384e78063f561 /tools | |
| parent | 430d525378bc7b318823fb1d5cba09da13ba9453 (diff) | |
doc/lua-filters: autogenerate docs for module pandoc.template
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/update-lua-module-docs.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/update-lua-module-docs.lua b/tools/update-lua-module-docs.lua index 12651f966..a13ffdadc 100644 --- a/tools/update-lua-module-docs.lua +++ b/tools/update-lua-module-docs.lua @@ -68,12 +68,15 @@ end local known_types = { Block = 'type-block', Blocks = 'type-blocks', + Doc = 'type-doc', ChunkedDoc = 'type-chunkeddoc', Inline = 'type-inline', Inlines = 'type-inlines', + Meta = 'type-meta', Pandoc = 'type-pandoc', SimpleTable = 'type-simpletable', Table = 'type-table', + Template = 'type-template', WriterOptions = 'type-writeroptions', Version = 'type-version', } @@ -221,6 +224,12 @@ end -- @param modulename name of the module that contains this function -- @return {Block,...} local function render_type (name, level, modulename) + -- FIXME: SPECIAL CASE + -- Ignore Template type in `pandoc.template` module, as the automatic + -- content doesn't describe it yet. + if name == 'pandoc Template' then + return {} + end -- We just want the modulename prefix, as the type names should already -- contain the module name to some extend. local nameprefix = modulename and @@ -285,11 +294,11 @@ local function render_module (doc) local typedocs = Blocks{} local types = type(doc.types) == 'function' and doc.types() or {} - if #types > 0 then - typedocs:insert(Header(2, 'Types', {doc.name .. '-' .. 'types'})) - for _, ty in ipairs(types) do - typedocs:extend(render_type(ty, 3, doc.name)) - end + for _, ty in ipairs(types) do + typedocs:extend(render_type(ty, 3, doc.name)) + end + if #typedocs > 0 then + typedocs:insert(1, Header(2, 'Types', {doc.name .. '-' .. 'types'})) end return Blocks{ |
