unknown typename check for kind_names; updated ldoc's config.ld
This commit is contained in:
parent
e5605a4a94
commit
b09f7f865f
|
@ -7,6 +7,7 @@ file='../ldoc.lua'
|
||||||
dir='../out'
|
dir='../out'
|
||||||
readme='doc.md'
|
readme='doc.md'
|
||||||
style='!pale'
|
style='!pale'
|
||||||
|
kind_names={topic='Manual',script='Programs'}
|
||||||
examples = {
|
examples = {
|
||||||
'../tests/styles/colon.lua',
|
'../tests/styles/colon.lua',
|
||||||
'../tests/styles/four.lua',
|
'../tests/styles/four.lua',
|
||||||
|
|
9
ldoc.lua
9
ldoc.lua
|
@ -119,10 +119,11 @@ local file_types = {
|
||||||
-- the ldoc table represents the API available in `config.ld`.
|
-- the ldoc table represents the API available in `config.ld`.
|
||||||
local ldoc = { charset = 'UTF-8' }
|
local ldoc = { charset = 'UTF-8' }
|
||||||
|
|
||||||
local kind_names
|
local known_types, kind_names = {}
|
||||||
|
|
||||||
local function lookup (itype,igroup,isubgroup)
|
local function lookup (itype,igroup,isubgroup)
|
||||||
local kn = kind_names[itype]
|
local kn = kind_names[itype]
|
||||||
|
known_types[itype] = true
|
||||||
if kn then
|
if kn then
|
||||||
if type(kn) == 'string' then
|
if type(kn) == 'string' then
|
||||||
igroup = kn
|
igroup = kn
|
||||||
|
@ -148,6 +149,12 @@ local function setup_kinds ()
|
||||||
ProjectMap:add_kind(lookup('classmod','Classes'))
|
ProjectMap:add_kind(lookup('classmod','Classes'))
|
||||||
ProjectMap:add_kind(lookup('topic','Topics'))
|
ProjectMap:add_kind(lookup('topic','Topics'))
|
||||||
ProjectMap:add_kind(lookup('example','Examples'))
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue