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',
|
||||
'boilerplate','merge', 'wrap', 'not_luadoc', 'template_escape',
|
||||
'no_return_or_parms','no_summary','full_description','backtick_references', 'custom_see_handler',
|
||||
'no_space_before_args',
|
||||
}
|
||||
ldoc_contents = tablex.makeset(ldoc_contents)
|
||||
|
||||
|
|
|
@ -737,7 +737,7 @@ function build_arg_list (names,pmods)
|
|||
end
|
||||
opt = m.optchain or m.opt
|
||||
if opt then
|
||||
acc(' [')
|
||||
acc('[')
|
||||
npending=npending+1
|
||||
end
|
||||
end
|
||||
|
|
|
@ -143,8 +143,14 @@ function html.generate_output(ldoc, args, project)
|
|||
|
||||
function ldoc.display_name(item)
|
||||
local name = item.display_name or item.name
|
||||
if item.type == 'function' or item.type == 'lfunction' then return name..' '..item.args --
|
||||
else return name end
|
||||
if item.type == 'function' or item.type == 'lfunction' then
|
||||
if not ldoc.no_space_before_args then
|
||||
name = name..' '
|
||||
end
|
||||
return name..item.args
|
||||
else
|
||||
return name
|
||||
end
|
||||
end
|
||||
|
||||
function ldoc.no_spaces(s)
|
||||
|
|
|
@ -27,7 +27,6 @@ end
|
|||
function two (one,two,three,four)
|
||||
end
|
||||
|
||||
|
||||
--- third useless function.
|
||||
-- Can always put comments inline, may
|
||||
-- be multiple.
|
||||
|
@ -38,6 +37,11 @@ function three ( -- person:
|
|||
-- not less than zero!
|
||||
)
|
||||
|
||||
---- function with single optional arg
|
||||
-- @param[opt] one
|
||||
function four (one)
|
||||
end
|
||||
|
||||
--- an implicit table.
|
||||
-- Again, we can use the comments
|
||||
person = {
|
||||
|
|
Loading…
Reference in New Issue