From 7d3db1dd2dd466718d1261003e65f9ddc4065f48 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 7 Feb 2022 08:34:21 +0100 Subject: Lua docs: fix typos, missing links --- tools/update-lua-module-docs.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools/update-lua-module-docs.lua') diff --git a/tools/update-lua-module-docs.lua b/tools/update-lua-module-docs.lua index 8d21d958e..9528e4663 100644 --- a/tools/update-lua-module-docs.lua +++ b/tools/update-lua-module-docs.lua @@ -44,10 +44,15 @@ local function render_results (results) return {BulletList( List(results):map( function (res) + -- Types starting with a capital letter are pandoc types, so we can + -- link them. + local type_ = res.type:match'^[A-Z]' + and Link(res.type, '#type-' .. res.type:lower()) + or Str(res.type) return Para( read_inlines(res.description) .. {Space()} - .. Inlines('(' .. res.type .. ')') + .. Inlines '(' .. Inlines{type_} .. Inlines ')' ) end ) -- cgit v1.2.3