Allow using @module, @script, @file, etc. multiple times in a file
Referenced issue: https://github.com/lunarmodules/LDoc/issues/305
This commit is contained in:
parent
147951025b
commit
c2e547422b
|
@ -1200,6 +1200,7 @@ configuration file.
|
||||||
- `merge` allow documentation from different files to be merged into modules without
|
- `merge` allow documentation from different files to be merged into modules without
|
||||||
explicit **@submodule** tag
|
explicit **@submodule** tag
|
||||||
- `icon` an image that will be displayed under the project name on all pages
|
- `icon` an image that will be displayed under the project name on all pages
|
||||||
|
- `multimodule` allow using @module, @script, @file, etc. multiple times in a file
|
||||||
|
|
||||||
_These only appear in the configuration file:_
|
_These only appear in the configuration file:_
|
||||||
|
|
||||||
|
|
5
ldoc.lua
5
ldoc.lua
|
@ -75,6 +75,7 @@ ldoc, a documentation generator for Lua, v]]..version..[[
|
||||||
--fatalwarnings non-zero exit status on any warning
|
--fatalwarnings non-zero exit status on any warning
|
||||||
--testing reproducible build; no date or version on output
|
--testing reproducible build; no date or version on output
|
||||||
--icon (default none) an image that will be displayed under the project name on all pages
|
--icon (default none) an image that will be displayed under the project name on all pages
|
||||||
|
--multimodule allow using @module, @script, @file, etc. multiple times in a file
|
||||||
|
|
||||||
<file> (string) source file or directory containing source
|
<file> (string) source file or directory containing source
|
||||||
|
|
||||||
|
@ -252,7 +253,7 @@ local ldoc_contents = {
|
||||||
'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
|
'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
|
||||||
'postprocess_html',
|
'postprocess_html',
|
||||||
'custom_css','version',
|
'custom_css','version',
|
||||||
'no_args_infer'
|
'no_args_infer', 'multimodule'
|
||||||
}
|
}
|
||||||
ldoc_contents = tablex.makeset(ldoc_contents)
|
ldoc_contents = tablex.makeset(ldoc_contents)
|
||||||
|
|
||||||
|
@ -446,6 +447,7 @@ override 'not_luadoc'
|
||||||
override 'module_file'
|
override 'module_file'
|
||||||
override 'boilerplate'
|
override 'boilerplate'
|
||||||
override 'all'
|
override 'all'
|
||||||
|
override 'multimodule'
|
||||||
|
|
||||||
setup_kinds()
|
setup_kinds()
|
||||||
|
|
||||||
|
@ -829,6 +831,7 @@ ldoc.title = ldoc.title or args.title
|
||||||
ldoc.project = ldoc.project or args.project
|
ldoc.project = ldoc.project or args.project
|
||||||
ldoc.package = args.package:match '%a+' and args.package or nil
|
ldoc.package = args.package:match '%a+' and args.package or nil
|
||||||
ldoc.icon = ldoc.icon or args.icon
|
ldoc.icon = ldoc.icon or args.icon
|
||||||
|
ldoc.multimodule = ldoc.multimodule or args.multimodule
|
||||||
|
|
||||||
local source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
|
local source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
|
||||||
if args.testing then
|
if args.testing then
|
||||||
|
|
|
@ -402,7 +402,7 @@ local function parse_file(fname, lang, package, args)
|
||||||
current_item = F:new_item(tags,line)
|
current_item = F:new_item(tags,line)
|
||||||
current_item.inferred = item_follows ~= nil
|
current_item.inferred = item_follows ~= nil
|
||||||
if doc.project_level(tags.class) then
|
if doc.project_level(tags.class) then
|
||||||
if module_item then
|
if module_item and not args.multimodule then
|
||||||
F:error("Module already declared!")
|
F:error("Module already declared!")
|
||||||
end
|
end
|
||||||
module_item = current_item
|
module_item = current_item
|
||||||
|
|
Loading…
Reference in New Issue