Codebase list lua-ldoc / ff2e5cc
Default output directory is now 'doc'; annotations were borked and not_luadoc check could blow up steve donovan 10 years ago
6 changed file(s) with 19 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
114114 if tags.summary ~= '' then return false end
115115 for tag, value in pairs(tags) do
116116 if known_tags._annotation_tags[tag] then
117 tags.class = 'annotation'
118 tags.summary = value
117 tags:add('class','annotation')
118 tags:add('summary',value)
119119 local item_name = last_item and last_item.tags.name or '?'
120 tags.name = item_name..'-'..tag..acount
120 tags:add('name',item_name..'-'..tag..acount)
121121 acount = acount + 1
122122 return true
123123 end
267267 -- add the item to the module's item list
268268 if this_mod then
269269 -- new-style modules will have qualified names like 'mod.foo'
270 --require 'pl.pretty'.dump(item.tags)
270271 local mod,fname = split_dotted_name(item.name)
271272 -- warning for inferred unqualified names in new style modules
272273 -- (retired until we handle methods like Set:unset() properly)
401402 if getmetatable(value) ~= List then
402403 value = List{value}
403404 end
404 if ttype ~= TAG_MULTI_LINE and args.not_luadoc then
405 if ttype ~= TAG_MULTI_LINE and args and args.not_luadoc then
405406 local last = value[#value]
406407 if type(last) == 'string' and last:match '\n' then
407408 local line,rest = last:match('([^\n]+)(.*)')
423424 if value == nil then self:error("Tag without value: "..tag) end
424425 local id, rest = tools.extract_identifier(value)
425426 self.tags[tag] = id
426 if args.not_luadoc then
427 if args and args.not_luadoc then
427428 self:add_to_description(rest)
428429 else
429430 self:trailing_warning('id',tag,rest)
249249 </div> <!-- id="content" -->
250250 </div> <!-- id="main" -->
251251 <div id="about">
252 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3.11</a></i>
252 <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3.12</a></i>
253253 </div> <!-- id="about" -->
254254 </div> <!-- id="container" -->
255255 </body>
3434
3535 --- @usage
3636 local usage = [[
37 ldoc, a documentation generator for Lua, vs 1.3.11
38 -d,--dir (default docs) output directory
37 ldoc, a documentation generator for Lua, vs 1.3.12
38 -d,--dir (default doc) output directory
3939 -o,--output (default 'index') output name
4040 -v,--verbose verbose
4141 -a,--all show local functions, etc, in docs
6262 <file> (string) source file or directory containing source
6363
6464 `ldoc .` reads options from an `config.ld` file in same directory;
65 `ldoc -c path/to/myconfig.ld .` reads options from `path/to/myconfig.ld`
65 `ldoc -c path/to/myconfig.ld <file>` reads options from `path/to/myconfig.ld`
66 and processes <file> if 'file' was not defined in the ld file.
6667 ]]
6768 local args = lapp(usage)
6869 local lfs = require 'lfs'
0 --- simplified LDoc style
0 --- simplified LDoc colon style.
1 -- You have to use -C flag or 'colon=true' for this one!
12 module 'easy'
23
34 --- First one.
1010 -- suppress @params and the summary at the top
1111 no_return_or_parms=true
1212 no_summary=true
13 not_luadoc=true
14
6969
7070 --[[-----------------
7171 @table Vector.Opts
72 Options table format for `Vector.options`
72 Options table format for `Vector:options`
7373
74 autoconvert: try to convert strings to numbers
74 * `autoconvert`: try to convert strings to numbers
75 * `adder`: function used to perform addition and subtraction
76 * `multiplier`: function used to perform multiplication and division
7577
76 adder: function used to perform addition and subtraction
77
78 multiplier: function used to perform multiplication and division
7978 @usage
8079 v = Vector {{1},{2}}
8180 v:options {adder = function(x,y) return {x[1]+y[1]} end}