diff --git a/doc.lua b/doc.lua index f7319b5..9b2226c 100644 --- a/doc.lua +++ b/doc.lua @@ -298,10 +298,16 @@ end -- Primarily intended as a debugging tool. function File:dump(verbose) for mod in self.modules:iter() do - print('Module:',mod.name,mod.summary,mod.description) - for item in mod.items:iter() do - item:dump(verbose) - end + mod:dump(verbose) + end +end + +function Module:dump(verbose) + print '----' + print(self.type..':',self.name,self.summary) + if self.description then print(self.description) end + for item in self.items:iter() do + item:dump(verbose) end end @@ -313,7 +319,7 @@ function Item:dump(verbose) end if verbose then print(self.type,name,self.summary) - print(self.description) + if self.description then print(self.description) end for p in self.params:iter() do print(p,self.params[p]) end diff --git a/ldoc.lua b/ldoc.lua index d6b60f3..2ec0946 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -25,6 +25,7 @@ ldoc, a Lua documentation generator, vs 0.1 Beta -t,--title (default Reference) page title -f,--format (default plain) formatting - can be markdown -b,--package (default '') top-level package basename (needed for module(...)) + --dump debug output dump (string) source file or directory containing source ]] @@ -429,6 +430,13 @@ if args.module then return end +if args.dump then + for mod in module_list:iter() do + mod:dump(true) + end + os.exit() +end + local css, templ = 'ldoc.css','ldoc.ltp' -- the style directory for template and stylesheet can be specified