refs to Lua 5.2 docs (if we are using 5.2) and bumped up major version to 1.2

This commit is contained in:
steve donovan 2012-03-13 10:37:07 +02:00
parent 20ddca927d
commit 9d0d12c31a
3 changed files with 41 additions and 19 deletions

View File

@ -1,3 +1,4 @@
#!/usr/bin/env lua
--------------- ---------------
-- ## ldoc, a Lua documentation generator. -- ## ldoc, a Lua documentation generator.
-- --
@ -26,7 +27,7 @@ app.require_here()
--- @usage --- @usage
local usage = [[ local usage = [[
ldoc, a documentation generator for Lua, vs 1.1.0 ldoc, a documentation generator for Lua, vs 1.2.0
-d,--dir (default docs) output directory -d,--dir (default docs) output directory
-o,--output (default 'index') output name -o,--output (default 'index') output name
-v,--verbose verbose -v,--verbose verbose

View File

@ -2,14 +2,13 @@
-- global functions and tables -- global functions and tables
local tools = require 'ldoc.tools' local tools = require 'ldoc.tools'
local globals = {} local globals = {}
local lua52 = _VERSION:match '5.2'
globals.functions = { globals.functions = {
assert = true, assert = true,
collectgarbage = true, collectgarbage = true,
dofile = true, dofile = true,
setfenv = true,
getfenv = true,
getmetatable = true, getmetatable = true,
setmetatable = true, setmetatable = true,
pairs = true, pairs = true,
@ -27,32 +26,54 @@ globals.functions = {
tonumber = true, tonumber = true,
tostring = true, tostring = true,
type = true, type = true,
unpack = true,
xpcall = true, xpcall = true,
module = true, module = true,
require = true, require = true,
} }
local functions = globals.functions local functions = globals.functions
globals.tables = { if not lua52 then
io = '5.7', functions.setfenv = true
package = '5.3', functions.getfenv = true
math = '5.6', functions.unpack = true
os = '5.8', else
string = '5.4', functions.rawlen = true
table = '5.5', end
coroutine = '5.2',
debug = '5.9'
}
local tables = globals.tables
local manual, fun_ref local manual, fun_ref
function globals.set_manual_url(url) function globals.set_manual_url(url)
manual = url .. '#' manual = url .. '#'
fun_ref = manual..'pdf-' fun_ref = manual..'pdf-'
end end
globals.set_manual_url 'http://www.lua.org/manual/5.1/manual.html'
if lua52 then
globals.tables = {
io = '6.8',
package = '6.3',
math = '6.6',
os = '6.9',
string = '6.4',
table = '6.5',
coroutine = '6.2',
debug = '6.10'
}
globals.set_manual_url 'http://www.lua.org/manual/5.2/manual.html'
else
globals.tables = {
io = '5.7',
package = '5.3',
math = '5.6',
os = '5.8',
string = '5.4',
table = '5.5',
coroutine = '5.2',
debug = '5.9'
}
globals.set_manual_url 'http://www.lua.org/manual/5.1/manual.html'
end
local tables = globals.tables
local function function_ref (name) local function function_ref (name)
return {href = fun_ref..name, label = name} return {href = fun_ref..name, label = name}

View File

@ -212,7 +212,7 @@ return [==[
</div> <!-- id="content" --> </div> <!-- id="content" -->
</div> <!-- id="main" --> </div> <!-- id="main" -->
<div id="about"> <div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.1</a></i> <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.2</a></i>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->
</body> </body>