Merge pull request #207 from zjarkov/master

Using ldoc.prettify_files the same way as for example ldoc.examples
This commit is contained in:
Steve J Donovan 2015-09-28 14:41:39 +02:00
commit 26b9a79384
2 changed files with 14 additions and 1 deletions

View File

@ -557,6 +557,8 @@ if type(ldoc.examples) == 'table' then
prettify_source_files(ldoc.examples,"example")
end
ldoc.is_file_prettyfied = {}
if ldoc.prettify_files then
local files = List()
local linemap = {}
@ -569,6 +571,17 @@ if ldoc.prettify_files then
end
linemap[F.filename] = ls
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)
end

View File

@ -153,7 +153,7 @@ return [==[
<dt>
<a name = "$(item.name)"></a>
<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>
# end
</dt>