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.
--
@ -26,7 +27,7 @@ app.require_here()
--- @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
-o,--output (default 'index') output name
-v,--verbose verbose

View File

@ -2,14 +2,13 @@
-- global functions and tables
local tools = require 'ldoc.tools'
local globals = {}
local lua52 = _VERSION:match '5.2'
globals.functions = {
assert = true,
collectgarbage = true,
dofile = true,
setfenv = true,
getfenv = true,
getmetatable = true,
setmetatable = true,
pairs = true,
@ -27,13 +26,40 @@ globals.functions = {
tonumber = true,
tostring = true,
type = true,
unpack = true,
xpcall = true,
module = true,
require = true,
}
local functions = globals.functions
if not lua52 then
functions.setfenv = true
functions.getfenv = true
functions.unpack = true
else
functions.rawlen = true
end
local manual, fun_ref
function globals.set_manual_url(url)
manual = url .. '#'
fun_ref = manual..'pdf-'
end
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',
@ -44,15 +70,10 @@ globals.tables = {
coroutine = '5.2',
debug = '5.9'
}
local tables = globals.tables
local manual, fun_ref
function globals.set_manual_url(url)
manual = url .. '#'
fun_ref = manual..'pdf-'
end
globals.set_manual_url 'http://www.lua.org/manual/5.1/manual.html'
end
local tables = globals.tables
local function function_ref (name)
return {href = fun_ref..name, label = name}

View File

@ -212,7 +212,7 @@ return [==[
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<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="container" -->
</body>