Default output directory is now 'doc'; annotations were borked and not_luadoc check could blow up
steve donovan
10 years ago
114 | 114 | if tags.summary ~= '' then return false end |
115 | 115 | for tag, value in pairs(tags) do |
116 | 116 | 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) | |
119 | 119 | 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) | |
121 | 121 | acount = acount + 1 |
122 | 122 | return true |
123 | 123 | end |
267 | 267 | -- add the item to the module's item list |
268 | 268 | if this_mod then |
269 | 269 | -- new-style modules will have qualified names like 'mod.foo' |
270 | --require 'pl.pretty'.dump(item.tags) | |
270 | 271 | local mod,fname = split_dotted_name(item.name) |
271 | 272 | -- warning for inferred unqualified names in new style modules |
272 | 273 | -- (retired until we handle methods like Set:unset() properly) |
401 | 402 | if getmetatable(value) ~= List then |
402 | 403 | value = List{value} |
403 | 404 | 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 | |
405 | 406 | local last = value[#value] |
406 | 407 | if type(last) == 'string' and last:match '\n' then |
407 | 408 | local line,rest = last:match('([^\n]+)(.*)') |
423 | 424 | if value == nil then self:error("Tag without value: "..tag) end |
424 | 425 | local id, rest = tools.extract_identifier(value) |
425 | 426 | self.tags[tag] = id |
426 | if args.not_luadoc then | |
427 | if args and args.not_luadoc then | |
427 | 428 | self:add_to_description(rest) |
428 | 429 | else |
429 | 430 | self:trailing_warning('id',tag,rest) |
249 | 249 | </div> <!-- id="content" --> |
250 | 250 | </div> <!-- id="main" --> |
251 | 251 | <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> | |
253 | 253 | </div> <!-- id="about" --> |
254 | 254 | </div> <!-- id="container" --> |
255 | 255 | </body> |
34 | 34 | |
35 | 35 | --- @usage |
36 | 36 | 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 | |
39 | 39 | -o,--output (default 'index') output name |
40 | 40 | -v,--verbose verbose |
41 | 41 | -a,--all show local functions, etc, in docs |
62 | 62 | <file> (string) source file or directory containing source |
63 | 63 | |
64 | 64 | `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. | |
66 | 67 | ]] |
67 | 68 | local args = lapp(usage) |
68 | 69 | 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! | |
1 | 2 | module 'easy' |
2 | 3 | |
3 | 4 | --- First one. |
10 | 10 | -- suppress @params and the summary at the top |
11 | 11 | no_return_or_parms=true |
12 | 12 | no_summary=true |
13 | not_luadoc=true | |
14 |
69 | 69 | |
70 | 70 | --[[----------------- |
71 | 71 | @table Vector.Opts |
72 | Options table format for `Vector.options` | |
72 | Options table format for `Vector:options` | |
73 | 73 | |
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 | |
75 | 77 | |
76 | adder: function used to perform addition and subtraction | |
77 | ||
78 | multiplier: function used to perform multiplication and division | |
79 | 78 | @usage |
80 | 79 | v = Vector {{1},{2}} |
81 | 80 | v:options {adder = function(x,y) return {x[1]+y[1]} end} |