Codebase list lua-ldoc / b248a2e
Modifications to pull #207; enable backward compatibility and fixed spelling mistake Steve Donovan 8 years ago
3 changed file(s) with 20 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
152152 <dt>
153153 <a name = "$(item.name)"></a>
154154 <strong>$(display_name(item))</strong>
155 # if ldoc.prettify_files and ldoc.is_file_prettyfied[item.module.file.filename] then
155 # if ldoc.prettify_files and ldoc.is_file_prettified[item.module.file.filename] then
156156 <a style="float:right;" href="$(ldoc.source_ref(item))">line $(item.lineno)</a>
157157 # end
158158 </dt>
556556 prettify_source_files(ldoc.examples,"example")
557557 end
558558
559 ldoc.is_file_prettyfied = {}
559 ldoc.is_file_prettified = {}
560560
561561 if ldoc.prettify_files then
562562 local files = List()
573573
574574 if type(ldoc.prettify_files) == 'table' then
575575 files = tools.expand_file_list(ldoc.prettify_files, '*.*')
576 -- -- not sure about resolving ldoc.prettify_files as string due to backward compatibility, see:
577 -- -- - tests/styles/opt.ld:7
578 -- -- - doc/html.lua:266
579 -- elseif type(ldoc.prettify_files) == 'string' then
580 -- files = tools.expand_file_list({ldoc.prettify_files}, '*.*')
581 end
582
583 ldoc.is_file_prettyfied = tablex.makeset(files)
576 elseif type(ldoc.prettify_files) == 'string' then
577 -- the gotcha is that if the person has a folder called 'show', only the contents
578 -- of that directory will be converted. So, we warn of this amibiguity
579 if ldoc.prettify_files == 'show' then
580 -- just fall through with all module files collected above
581 if path.exists 'show' then
582 print("Notice: if you only want to prettify files in `show`, then set prettify_files to `show/`")
583 end
584 else
585 files = tools.expand_file_list({ldoc.prettify_files}, '*.*')
586 end
587 end
588
589 ldoc.is_file_prettified = tablex.makeset(files)
584590 prettify_source_files(files,"file",linemap)
585591 end
586592
00 ------------
1 -- Functions with options and custom tags
1 -- ### Functions with options and custom tags.
2 -- (use `ldoc -c opt.ld opt.lua` for converting.)
23 --
34 -- @include opt.md
45
56 ---- testing [opt]
67 -- @param one
78 -- @param[opt] two
8 -- @param[opt]three
9 -- @param[opt] three
910 -- @param[opt] four
1011 -- @remark use with caution!
1112 function use_opt (one,two,three,four)
1213 end
1314
1415 --- an explicit table.
15 -- Can now use tparam aliases in table defns
16 -- Can use tparam aliases in table defns
1617 -- @string name
1718 -- @int[opt=0] age
1819 -- @table person2