added module merging - see tests/merge directory (--merge flag)
This commit is contained in:
parent
10b5819667
commit
55bbeed4f4
4
ldoc.lua
4
ldoc.lua
|
@ -55,6 +55,7 @@ ldoc, a documentation generator for Lua, vs 1.3.1
|
|||
-D,--define (default none) set a flag to be used in config.ld
|
||||
-C,--colon use colon style
|
||||
-B,--boilerplate ignore first comment in source files
|
||||
-M,--merge allow module merging
|
||||
--dump debug output dump
|
||||
--filter (default none) filter output as Lua data (e.g pl.pretty.dump)
|
||||
--tags (default none) show all references to given tags, comma-separated
|
||||
|
@ -181,7 +182,7 @@ local ldoc_contents = {
|
|||
'alias','add_language_extension','new_type','add_section', 'tparam_alias',
|
||||
'file','project','title','package','format','output','dir','ext', 'topics',
|
||||
'one','style','template','description','examples',
|
||||
'readme','all','manual_url', 'ignore', 'colon','boilerplate',
|
||||
'readme','all','manual_url', 'ignore', 'colon','boilerplate','merge',
|
||||
'no_return_or_parms','no_summary','full_description','backtick_references', 'custom_see_handler',
|
||||
}
|
||||
ldoc_contents = tablex.makeset(ldoc_contents)
|
||||
|
@ -348,6 +349,7 @@ local process_file_list = tools.process_file_list
|
|||
setup_package_base()
|
||||
|
||||
override 'colon'
|
||||
override 'merge'
|
||||
|
||||
if type(args.file) == 'table' then
|
||||
-- this can only be set from config file so we can assume it's already read
|
||||
|
|
|
@ -215,6 +215,14 @@ function File:finish()
|
|||
if item.type == 'module' then
|
||||
-- if name is 'package.mod', then mod_name is 'mod'
|
||||
package,mname = split_dotted_name(this_mod.name)
|
||||
if self.args.merge then
|
||||
local mod,mf = find_module_in_files(item.name)
|
||||
if mod then
|
||||
print('found master module',mf)
|
||||
this_mod = mod
|
||||
submodule = true
|
||||
end
|
||||
end
|
||||
elseif item.type == 'submodule' then
|
||||
local mf
|
||||
submodule = true
|
||||
|
|
|
@ -150,6 +150,8 @@ local function parse_file(fname, lang, package, args)
|
|||
local module_found, first_comment = false,true
|
||||
local current_item, module_item
|
||||
|
||||
F.args = args
|
||||
|
||||
F.base = package
|
||||
|
||||
local tok,f = lang.lexer(fname)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
merge=true
|
||||
file={'merge1.lua','merge2.lua'}
|
|
@ -0,0 +1,7 @@
|
|||
----
|
||||
-- main module
|
||||
-- @module merge
|
||||
|
||||
---- first fun
|
||||
function one()
|
||||
end
|
|
@ -0,0 +1,19 @@
|
|||
----
|
||||
-- submodule
|
||||
-- @module merge
|
||||
|
||||
---- second fun
|
||||
-- @param x
|
||||
function two(x)
|
||||
end
|
||||
|
||||
--- extra stuff
|
||||
-- @section extra
|
||||
|
||||
--- third fun
|
||||
function three ()
|
||||
end
|
||||
|
||||
--- fourth fun
|
||||
function four ()
|
||||
end
|
Loading…
Reference in New Issue