diff --git a/doc/config.ld b/doc/config.ld index 54e4052..f45b293 100644 --- a/doc/config.ld +++ b/doc/config.ld @@ -7,6 +7,7 @@ file='../ldoc.lua' dir='../out' readme='doc.md' style='!pale' +kind_names={topic='Manual',script='Programs'} examples = { '../tests/styles/colon.lua', '../tests/styles/four.lua', diff --git a/ldoc.lua b/ldoc.lua index afb424c..3ada4e5 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -119,10 +119,11 @@ local file_types = { -- the ldoc table represents the API available in `config.ld`. local ldoc = { charset = 'UTF-8' } -local kind_names +local known_types, kind_names = {} local function lookup (itype,igroup,isubgroup) local kn = kind_names[itype] + known_types[itype] = true if kn then if type(kn) == 'string' then igroup = kn @@ -148,6 +149,12 @@ local function setup_kinds () ProjectMap:add_kind(lookup('classmod','Classes')) ProjectMap:add_kind(lookup('topic','Topics')) ProjectMap:add_kind(lookup('example','Examples')) + + for k in pairs(kind_names) do + if not known_types[k] then + quit("unknown item type "..tools.quote(k).." in kind_names") + end + end end