initial implementation of -all flag; default is to hide local functions from documentation

This commit is contained in:
steve donovan 2011-06-15 16:33:13 +02:00
parent c57c364335
commit 7c02820692
2 changed files with 22 additions and 7 deletions

View File

@ -21,6 +21,7 @@ ldoc, a documentation generator for Lua, vs 0.3 Beta
-d,--dir (default docs) output directory
-o,--output (default 'index') output name
-v,--verbose verbose
-a,--all show local functions, etc, in docs
-q,--quiet suppress output
-m,--module module docs as text
-s,--style (default !) directory for style sheet (ldoc.css)
@ -558,6 +559,13 @@ 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 then
for mod in module_list:iter() do
mod:mask_locals()
end
end
table.sort(module_list,function(m1,m2)
return m1.name < m2.name
end)

View File

@ -350,13 +350,11 @@ function Module:resolve_references(modules)
end
end
-- make a text dump of the contents of this File object.
-- The level of detail is controlled by the 'verbose' parameter.
-- Primarily intended as a debugging tool.
function File:dump(verbose)
for mod in self.modules:iter() do
mod:dump(verbose)
end
-- suppress the display of local functions.
-- 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
end
function Module:dump(verbose)
@ -368,6 +366,15 @@ function Module:dump(verbose)
end
end
-- make a text dump of the contents of this File object.
-- The level of detail is controlled by the 'verbose' parameter.
-- Primarily intended as a debugging tool.
function File:dump(verbose)
for mod in self.modules:iter() do
mod:dump(verbose)
end
end
function Item:dump(verbose)
local tags = self.tags
local name = self.name