Fixed Issue 301

This commit is contained in:
eruber 2018-07-06 15:20:54 -07:00
parent f91c3182cf
commit e677dc1121
1 changed files with 7 additions and 5 deletions

View File

@ -152,7 +152,7 @@ function html.generate_output(ldoc, args, project)
end end
return base..name..'.html' return base..name..'.html'
end end
function ldoc.include_file (file) function ldoc.include_file (file)
local text,e = utils.readfile(file) local text,e = utils.readfile(file)
if not text then quit("unable to include "..file) if not text then quit("unable to include "..file)
@ -161,14 +161,16 @@ function html.generate_output(ldoc, args, project)
end end
end end
-- these references are never from the index...? -- these references are never from the index...?
function ldoc.source_ref (fun) function ldoc.source_ref (fun)
local modname = fun.module.name local modname = fun.module.name
local path, ext
path, ext = tools.split_dotted_name(fun.module.file.filename)
local pack,name = tools.split_dotted_name(modname) local pack,name = tools.split_dotted_name(modname)
if not pack then if not pack then
name = modname name = modname
end end
return (ldoc.single and "" or "../").."source/"..name..'.lua.html#'..fun.lineno return (ldoc.single and "" or "../").."source/"..name..'.'..ext..'.html#'..fun.lineno
end end
function ldoc.use_li(ls) function ldoc.use_li(ls)
@ -212,7 +214,7 @@ function ldoc.source_ref (fun)
function ldoc.is_list (t) function ldoc.is_list (t)
return type(t) == 'table' and t.append return type(t) == 'table' and t.append
end end
function ldoc.strip_header (s) function ldoc.strip_header (s)
if not s then return s end if not s then return s end
return s:gsub('^%s*#+%s+','') return s:gsub('^%s*#+%s+','')