Lua docs: fix typos, missing links

This commit is contained in:
Albert Krewinkel
2022-02-07 08:34:21 +01:00
parent 2b3433404e
commit 7d3db1dd2d
3 changed files with 56 additions and 49 deletions
+6 -1
View File
@@ -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
)