Default output directory is now 'doc'; annotations were borked and not_luadoc check could blow up
This commit is contained in:
parent
cf7b8e3a9a
commit
ff2e5ccaed
7
ldoc.lua
7
ldoc.lua
|
@ -35,8 +35,8 @@ app.require_here()
|
|||
|
||||
--- @usage
|
||||
local usage = [[
|
||||
ldoc, a documentation generator for Lua, vs 1.3.11
|
||||
-d,--dir (default docs) output directory
|
||||
ldoc, a documentation generator for Lua, vs 1.3.12
|
||||
-d,--dir (default doc) output directory
|
||||
-o,--output (default 'index') output name
|
||||
-v,--verbose verbose
|
||||
-a,--all show local functions, etc, in docs
|
||||
|
@ -63,7 +63,8 @@ ldoc, a documentation generator for Lua, vs 1.3.11
|
|||
<file> (string) source file or directory containing source
|
||||
|
||||
`ldoc .` reads options from an `config.ld` file in same directory;
|
||||
`ldoc -c path/to/myconfig.ld .` reads options from `path/to/myconfig.ld`
|
||||
`ldoc -c path/to/myconfig.ld <file>` reads options from `path/to/myconfig.ld`
|
||||
and processes <file> if 'file' was not defined in the ld file.
|
||||
]]
|
||||
local args = lapp(usage)
|
||||
local lfs = require 'lfs'
|
||||
|
|
11
ldoc/doc.lua
11
ldoc/doc.lua
|
@ -115,10 +115,10 @@ function doc.expand_annotation_item (tags, last_item)
|
|||
if tags.summary ~= '' then return false end
|
||||
for tag, value in pairs(tags) do
|
||||
if known_tags._annotation_tags[tag] then
|
||||
tags.class = 'annotation'
|
||||
tags.summary = value
|
||||
tags:add('class','annotation')
|
||||
tags:add('summary',value)
|
||||
local item_name = last_item and last_item.tags.name or '?'
|
||||
tags.name = item_name..'-'..tag..acount
|
||||
tags:add('name',item_name..'-'..tag..acount)
|
||||
acount = acount + 1
|
||||
return true
|
||||
end
|
||||
|
@ -268,6 +268,7 @@ function File:finish()
|
|||
-- add the item to the module's item list
|
||||
if this_mod then
|
||||
-- new-style modules will have qualified names like 'mod.foo'
|
||||
--require 'pl.pretty'.dump(item.tags)
|
||||
local mod,fname = split_dotted_name(item.name)
|
||||
-- warning for inferred unqualified names in new style modules
|
||||
-- (retired until we handle methods like Set:unset() properly)
|
||||
|
@ -402,7 +403,7 @@ function Item:set_tag (tag,value)
|
|||
if getmetatable(value) ~= List then
|
||||
value = List{value}
|
||||
end
|
||||
if ttype ~= TAG_MULTI_LINE and args.not_luadoc then
|
||||
if ttype ~= TAG_MULTI_LINE and args and args.not_luadoc then
|
||||
local last = value[#value]
|
||||
if type(last) == 'string' and last:match '\n' then
|
||||
local line,rest = last:match('([^\n]+)(.*)')
|
||||
|
@ -424,7 +425,7 @@ function Item:set_tag (tag,value)
|
|||
if value == nil then self:error("Tag without value: "..tag) end
|
||||
local id, rest = tools.extract_identifier(value)
|
||||
self.tags[tag] = id
|
||||
if args.not_luadoc then
|
||||
if args and args.not_luadoc then
|
||||
self:add_to_description(rest)
|
||||
else
|
||||
self:trailing_warning('id',tag,rest)
|
||||
|
|
|
@ -250,7 +250,7 @@ return [==[
|
|||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3.11</a></i>
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3.12</a></i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
--- simplified LDoc style
|
||||
--- simplified LDoc colon style.
|
||||
-- You have to use -C flag or 'colon=true' for this one!
|
||||
module 'easy'
|
||||
|
||||
--- First one.
|
||||
|
|
|
@ -11,3 +11,5 @@ pretty='lxsh'
|
|||
-- suppress @params and the summary at the top
|
||||
no_return_or_parms=true
|
||||
no_summary=true
|
||||
not_luadoc=true
|
||||
|
||||
|
|
|
@ -70,13 +70,12 @@ end
|
|||
|
||||
--[[-----------------
|
||||
@table Vector.Opts
|
||||
Options table format for `Vector.options`
|
||||
Options table format for `Vector:options`
|
||||
|
||||
autoconvert: try to convert strings to numbers
|
||||
* `autoconvert`: try to convert strings to numbers
|
||||
* `adder`: function used to perform addition and subtraction
|
||||
* `multiplier`: function used to perform multiplication and division
|
||||
|
||||
adder: function used to perform addition and subtraction
|
||||
|
||||
multiplier: function used to perform multiplication and division
|
||||
@usage
|
||||
v = Vector {{1},{2}}
|
||||
v:options {adder = function(x,y) return {x[1]+y[1]} end}
|
||||
|
|
Loading…
Reference in New Issue