more general method of controlling visibility of local functions or items marked with @local
This commit is contained in:
parent
b3f6fc2762
commit
f507e36720
7
ldoc.lua
7
ldoc.lua
|
@ -553,12 +553,7 @@ for mod in module_list:iter() do
|
|||
project:add(mod,module_list)
|
||||
end
|
||||
|
||||
-- the default is not to show local functions in the documentation.
|
||||
if not args.all and not ldoc.all then
|
||||
for mod in module_list:iter() do
|
||||
mod:mask_locals()
|
||||
end
|
||||
end
|
||||
override 'all'
|
||||
|
||||
if ldoc.sort_modules then
|
||||
table.sort(module_list,function(m1,m2)
|
||||
|
|
13
ldoc/doc.lua
13
ldoc/doc.lua
|
@ -230,7 +230,10 @@ function File:finish()
|
|||
end
|
||||
end
|
||||
item:finish()
|
||||
if doc.project_level(item.type) then
|
||||
-- the default is not to show local functions in the documentation.
|
||||
if not self.args.all and (item.type=='lfunction' or (item.tags and item.tags['local'])) then
|
||||
-- don't add to the module --
|
||||
elseif doc.project_level(item.type) then
|
||||
this_mod = item
|
||||
local package,mname,submodule
|
||||
if item.type == 'module' then
|
||||
|
@ -1187,14 +1190,6 @@ function Module:resolve_references(modules)
|
|||
end
|
||||
end
|
||||
|
||||
-- suppress the display of local functions and annotations.
|
||||
-- This is just a placeholder hack until we have a more general scheme
|
||||
-- for indicating 'private' content of a module.
|
||||
function Module:mask_locals ()
|
||||
self.kinds['Local Functions'] = nil
|
||||
self.kinds['Annotations'] = nil
|
||||
end
|
||||
|
||||
function Item:dump_tags (taglist)
|
||||
for tag, value in pairs(self.tags) do
|
||||
if not taglist or taglist[tag] then
|
||||
|
|
|
@ -25,6 +25,15 @@ function Bonzo:dog ()
|
|||
|
||||
end
|
||||
|
||||
----
|
||||
-- Private method.
|
||||
-- You need -a flag or 'all=true' to see these
|
||||
-- @local
|
||||
function Bonzo:cat ()
|
||||
|
||||
end
|
||||
|
||||
|
||||
----
|
||||
-- A subtable with fields.
|
||||
-- @table Details
|
||||
|
|
Loading…
Reference in New Issue