Modifications to pull #207; enable backward compatibility and fixed spelling mistake
This commit is contained in:
parent
26b9a79384
commit
b248a2e035
20
ldoc.lua
20
ldoc.lua
|
@ -557,7 +557,7 @@ if type(ldoc.examples) == 'table' then
|
|||
prettify_source_files(ldoc.examples,"example")
|
||||
end
|
||||
|
||||
ldoc.is_file_prettyfied = {}
|
||||
ldoc.is_file_prettified = {}
|
||||
|
||||
if ldoc.prettify_files then
|
||||
local files = List()
|
||||
|
@ -574,14 +574,20 @@ if ldoc.prettify_files then
|
|||
|
||||
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}, '*.*')
|
||||
elseif type(ldoc.prettify_files) == 'string' then
|
||||
-- the gotcha is that if the person has a folder called 'show', only the contents
|
||||
-- of that directory will be converted. So, we warn of this amibiguity
|
||||
if ldoc.prettify_files == 'show' then
|
||||
-- just fall through with all module files collected above
|
||||
if path.exists 'show' then
|
||||
print("Notice: if you only want to prettify files in `show`, then set prettify_files to `show/`")
|
||||
end
|
||||
else
|
||||
files = tools.expand_file_list({ldoc.prettify_files}, '*.*')
|
||||
end
|
||||
end
|
||||
|
||||
ldoc.is_file_prettyfied = tablex.makeset(files)
|
||||
ldoc.is_file_prettified = tablex.makeset(files)
|
||||
prettify_source_files(files,"file",linemap)
|
||||
end
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ return [==[
|
|||
<dt>
|
||||
<a name = "$(item.name)"></a>
|
||||
<strong>$(display_name(item))</strong>
|
||||
# if ldoc.prettify_files and ldoc.is_file_prettyfied[item.module.file.filename] then
|
||||
# if ldoc.prettify_files and ldoc.is_file_prettified[item.module.file.filename] then
|
||||
<a style="float:right;" href="$(ldoc.source_ref(item))">line $(item.lineno)</a>
|
||||
# end
|
||||
</dt>
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
------------
|
||||
-- Functions with options and custom tags
|
||||
-- ### Functions with options and custom tags.
|
||||
-- (use `ldoc -c opt.ld opt.lua` for converting.)
|
||||
--
|
||||
-- @include opt.md
|
||||
|
||||
---- testing [opt]
|
||||
-- @param one
|
||||
-- @param[opt] two
|
||||
-- @param[opt]three
|
||||
-- @param[opt] three
|
||||
-- @param[opt] four
|
||||
-- @remark use with caution!
|
||||
function use_opt (one,two,three,four)
|
||||
end
|
||||
|
||||
--- an explicit table.
|
||||
-- Can now use tparam aliases in table defns
|
||||
-- Can use tparam aliases in table defns
|
||||
-- @string name
|
||||
-- @int[opt=0] age
|
||||
-- @table person2
|
||||
|
|
Loading…
Reference in New Issue