Codebase list lua-ldoc / 3d31f32
--testing: version and date does not change. Bump to 1.4.4 steve donovan 7 years ago
5 changed file(s) with 34 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
305305 </div> <!-- id="content" -->
306306 </div> <!-- id="main" -->
307307 <div id="about">
308 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
308 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc $(ldoc.version)</a></i>
309309 <i style="float:right;">Last updated $(ldoc.updatetime) </i>
310310 </div> <!-- id="about" -->
311311 </div> <!-- id="container" -->
2626
2727 -- Penlight compatibility
2828 utils.unpack = utils.unpack or unpack or table.unpack
29
3029 local append = table.insert
31
3230 local lapp = require 'pl.lapp'
31
32 local version = '1.4.4'
3333
3434 -- so we can find our private modules
3535 app.require_here()
3636
3737 --- @usage
3838 local usage = [[
39 ldoc, a documentation generator for Lua, vs 1.4.3
39 ldoc, a documentation generator for Lua, vs ]]..version..[[
40
4041 -d,--dir (default doc) output directory
4142 -o,--output (default 'index') output name
4243 -v,--verbose verbose
6566 --filter (default none) filter output as Lua data (e.g pl.pretty.dump)
6667 --tags (default none) show all references to given tags, comma-separated
6768 --fatalwarnings non-zero exit status on any warning
69 --testing reproducible build; no date or version on output
70
6871 <file> (string) source file or directory containing source
6972
7073 `ldoc .` reads options from an `config.ld` file in same directory;
100103 self.fieldname = 'type'
101104 end
102105
103
104
105106 local lua, cc = lang.lua, lang.cc
106107
107108 local file_types = {
119120 ------- ldoc external API ------------
120121
121122 -- the ldoc table represents the API available in `config.ld`.
122 local ldoc = { charset = 'UTF-8' }
123 local ldoc = { charset = 'UTF-8', version = version }
123124
124125 local known_types, kind_names = {}
125126
237238 'unqualified', 'custom_display_name_handler', 'kind_names', 'custom_references',
238239 'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
239240 'postprocess_html',
240 'custom_css',
241 'custom_css','version'
241242 }
242243 ldoc_contents = tablex.makeset(ldoc_contents)
243244
805806 ldoc.project = ldoc.project or args.project
806807 ldoc.package = args.package:match '%a+' and args.package or nil
807808
808 if os.getenv("SOURCE_DATE_EPOCH") == nil then
809 local source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
810 if args.testing then
811 ldoc.updatetime = "2015-01-01 12:00:00"
812 ldoc.version = 'TESTING'
813 elseif source_date_epoch == nil then
809814 if args.date == 'system' then
810815 ldoc.updatetime = os.date("%Y-%m-%d %H:%M:%S")
811816 else
812817 ldoc.updatetime = args.date
813818 end
814819 else
815 ldoc.updatetime = os.date("!%Y-%m-%d %H:%M:%S",os.getenv("SOURCE_DATE_EPOCH"))
820 ldoc.updatetime = os.date("!%Y-%m-%d %H:%M:%S",source_date_epoch)
816821 end
817822
818823 local html = require 'ldoc.html'
0 function run_test(dir)
1 os.execute('cd '..dir..' && ldoc --testing . && diff -r doc cdocs')
0 local run
1 if not arg[1] then
2 run = function (dir)
3 local cmd = 'cd '..dir..' && ldoc --testing . && diff -r doc cdocs'
4 print(cmd)
5 os.execute(cmd)
6 end
7 elseif arg[1] == 'update' then
8 run = function (dir)
9 local cmd = 'cd '..dir..' && ldoc --dir cdocs --testing .'
10 print(cmd)
11 os.execute(cmd)
12 end
213 end
3 run_test('tests')
4 run_test('tests/example')
5 run_test('tests/md-test')
14
15 for _,d in ipairs{'tests','tests/example','tests/md-test'} do
16 run(d)
17 end
99 _M.Bonzo = class()
1010
1111 --- a method.
12 -- function one
12 -- function one; reference to @{one.md.classes|documentation}
1313 function Bonzo:one()
1414
1515 end
11 project = 'Basic Example'
22 file = {'types.lua','classes.lua'}
33 use_markdown_titles=true
4 topics = {'one 1.md','two.md'}
4 topics = {'one.md','two.md'}