diff --git a/ldoc.lua b/ldoc.lua index 8b7aaadb..9ae13e86 100644 --- a/ldoc.lua +++ b/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) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 4e08dbcf..7be979fb 100644 --- a/ldoc/doc.lua +++ b/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 diff --git a/tests/styles/type.lua b/tests/styles/type.lua index 6f2158d8..8499dc8e 100644 --- a/tests/styles/type.lua +++ b/tests/styles/type.lua @@ -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