fix #84; also no_space_before_args=false to stop ldoc putting space between name and arglist of functions
This commit is contained in:
parent
5699d002ef
commit
dfdac3f977
1
ldoc.lua
1
ldoc.lua
|
@ -191,6 +191,7 @@ local ldoc_contents = {
|
||||||
'readme','all','manual_url', 'ignore', 'colon', 'sort', 'module_file',
|
'readme','all','manual_url', 'ignore', 'colon', 'sort', 'module_file',
|
||||||
'boilerplate','merge', 'wrap', 'not_luadoc', 'template_escape',
|
'boilerplate','merge', 'wrap', 'not_luadoc', 'template_escape',
|
||||||
'no_return_or_parms','no_summary','full_description','backtick_references', 'custom_see_handler',
|
'no_return_or_parms','no_summary','full_description','backtick_references', 'custom_see_handler',
|
||||||
|
'no_space_before_args',
|
||||||
}
|
}
|
||||||
ldoc_contents = tablex.makeset(ldoc_contents)
|
ldoc_contents = tablex.makeset(ldoc_contents)
|
||||||
|
|
||||||
|
|
|
@ -737,7 +737,7 @@ function build_arg_list (names,pmods)
|
||||||
end
|
end
|
||||||
opt = m.optchain or m.opt
|
opt = m.optchain or m.opt
|
||||||
if opt then
|
if opt then
|
||||||
acc(' [')
|
acc('[')
|
||||||
npending=npending+1
|
npending=npending+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -143,8 +143,14 @@ function html.generate_output(ldoc, args, project)
|
||||||
|
|
||||||
function ldoc.display_name(item)
|
function ldoc.display_name(item)
|
||||||
local name = item.display_name or item.name
|
local name = item.display_name or item.name
|
||||||
if item.type == 'function' or item.type == 'lfunction' then return name..' '..item.args --
|
if item.type == 'function' or item.type == 'lfunction' then
|
||||||
else return name end
|
if not ldoc.no_space_before_args then
|
||||||
|
name = name..' '
|
||||||
|
end
|
||||||
|
return name..item.args
|
||||||
|
else
|
||||||
|
return name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ldoc.no_spaces(s)
|
function ldoc.no_spaces(s)
|
||||||
|
|
|
@ -27,7 +27,6 @@ end
|
||||||
function two (one,two,three,four)
|
function two (one,two,three,four)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- third useless function.
|
--- third useless function.
|
||||||
-- Can always put comments inline, may
|
-- Can always put comments inline, may
|
||||||
-- be multiple.
|
-- be multiple.
|
||||||
|
@ -38,6 +37,11 @@ function three ( -- person:
|
||||||
-- not less than zero!
|
-- not less than zero!
|
||||||
)
|
)
|
||||||
|
|
||||||
|
---- function with single optional arg
|
||||||
|
-- @param[opt] one
|
||||||
|
function four (one)
|
||||||
|
end
|
||||||
|
|
||||||
--- an implicit table.
|
--- an implicit table.
|
||||||
-- Again, we can use the comments
|
-- Again, we can use the comments
|
||||||
person = {
|
person = {
|
||||||
|
|
Loading…
Reference in New Issue