diff --git a/ldoc.lua b/ldoc.lua index 90d8eed..727472a 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -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) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 30c8344..2867aaa 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -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