Using ldoc.prettify_files the same way as for example ldoc.examples
This commit is contained in:
parent
2241932602
commit
9f6c84f8bc
13
ldoc.lua
13
ldoc.lua
|
@ -557,6 +557,8 @@ if type(ldoc.examples) == 'table' then
|
||||||
prettify_source_files(ldoc.examples,"example")
|
prettify_source_files(ldoc.examples,"example")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ldoc.is_file_prettyfied = {}
|
||||||
|
|
||||||
if ldoc.prettify_files then
|
if ldoc.prettify_files then
|
||||||
local files = List()
|
local files = List()
|
||||||
local linemap = {}
|
local linemap = {}
|
||||||
|
@ -569,6 +571,17 @@ if ldoc.prettify_files then
|
||||||
end
|
end
|
||||||
linemap[F.filename] = ls
|
linemap[F.filename] = ls
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if type(ldoc.prettify_files) == 'table' then
|
||||||
|
files = tools.expand_file_list(ldoc.prettify_files, '*.*')
|
||||||
|
-- -- not sure about resolving ldoc.prettify_files as string due to backward compatibility, see:
|
||||||
|
-- -- - tests/styles/opt.ld:7
|
||||||
|
-- -- - doc/html.lua:266
|
||||||
|
-- elseif type(ldoc.prettify_files) == 'string' then
|
||||||
|
-- files = tools.expand_file_list({ldoc.prettify_files}, '*.*')
|
||||||
|
end
|
||||||
|
|
||||||
|
ldoc.is_file_prettyfied = tablex.makeset(files)
|
||||||
prettify_source_files(files,"file",linemap)
|
prettify_source_files(files,"file",linemap)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ return [==[
|
||||||
<dt>
|
<dt>
|
||||||
<a name = "$(item.name)"></a>
|
<a name = "$(item.name)"></a>
|
||||||
<strong>$(display_name(item))</strong>
|
<strong>$(display_name(item))</strong>
|
||||||
# if ldoc.prettify_files then
|
# if ldoc.prettify_files and ldoc.is_file_prettyfied[item.module.file.filename] then
|
||||||
<a style="float:right;" href="$(ldoc.source_ref(item))">line $(item.lineno)</a>
|
<a style="float:right;" href="$(ldoc.source_ref(item))">line $(item.lineno)</a>
|
||||||
# end
|
# end
|
||||||
</dt>
|
</dt>
|
||||||
|
|
Loading…
Reference in New Issue