LuaDoc 3.0.1 Lua源代码文档生成工具
来源:互联网 发布:ipad格子音乐软件 编辑:程序博客网 时间:2024/05/18 01:55
LuaDoc是一个Lua源代码文件文档生成工具。
项目地址:http://luadoc.luaforge.net
当前版本:3.0.1
LuaDoc需要依赖LuaFileSystem和LuaLogging,我们可以直接下载Lua for Windows(http://code.google.com/p/luaforwindows/),这是带有LuaDoc的整合包,我们可以在Lua For Windows目录下看到luadoc_start.bat文件,打开后如下:
lua.exe "%LUA_DEV%\lua\luadoc_start.lua" %*
这是批处理自动生成文档。
luadoc_start.lua的命令如下:
2
3
4
5
6
7
8
9
10
11
12
Usage: d:\Program Files\Lua\5.1\lua\luadoc_start.lua [options|files]
Generate documentation from files. Available options are:
-d path output directory path
-t path template directory path
-h, --help print this help and exit
--noindexpage do not generate global index page
--nofiles do not generate documentation for files
--nomodules do not generate documentation for modules
--doclet doclet_module doclet module to generate output
--taglet taglet_module taglet module to parse input code
-q, --quiet suppress all normal output
-v, --version print version information
Generate documentation from files. Available options are:
-d path output directory path
-t path template directory path
-h, --help print this help and exit
--noindexpage do not generate global index page
--nofiles do not generate documentation for files
--nomodules do not generate documentation for modules
--doclet doclet_module doclet module to generate output
--taglet taglet_module taglet module to parse input code
-q, --quiet suppress all normal output
-v, --version print version information
LuaDoc的注释以连续的三个减号开始,所支持的标签包括如下:
@author <text>
@copyright <text>
@field
@param <word> <text>
@release <text>
@return <text>
@see <text>
@usage <text>
和三个LuaDoc可自动推导的标签,可以手动指定以覆盖所推导的值:
@class <word>
@description
@name <word>下面测试LuaDoc使用,新建一个Lua文件,测试代码如下:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- 测试用表
-- @class table
-- @name testTable
-- @field testA 测试字段A
-- @field testB 测试字段B
testTable =
{
testA = nil,
testB = nil,
}
--- 测试函数
-- @param a 参数a
-- @param b 参数b
-- @return 返回1
-- @usage testFun(1, 2)
-- @see testTable
function testFun(a, b)
return 1
end
-- @class table
-- @name testTable
-- @field testA 测试字段A
-- @field testB 测试字段B
testTable =
{
testA = nil,
testB = nil,
}
--- 测试函数
-- @param a 参数a
-- @param b 参数b
-- @return 返回1
-- @usage testFun(1, 2)
-- @see testTable
function testFun(a, b)
return 1
end
在Lua工程文件夹下,新建一个批处理,内容如下:
lua.exe "%LUA_DEV%\lua\luadoc_start.lua" -d "Docs" *
自动将Lua源代码生成文档,保存在Docs目录下。若生成过程没有错误的话,在Docs目录下打开index.html,效果如下图所示:
点击进去,效果如下图所示:
参考资料:
1.luadoc manual http://keplerproject.github.com/luadoc/manual.html
2.Windows下使用luaDoc给lua生成文档 http://www.cppblog.com/tx7do/archive/2010/07/25/121209.html
- LuaDoc 3.0.1 Lua源代码文档生成工具
- 源代码文档生成工具----Doxygen
- 源代码文档自动生成工具 Doxygen
- 用Doxygen生成源代码文档
- 文档生成工具-NaturalDocs
- JAVASCRIPT 文档生成工具
- 帮助文档生成工具
- 数据库文档生成工具
- 数据库文档生成工具
- 自动文档生成工具
- 代码生成文档工具
- 自动文档生成工具
- Mysql 文档生成工具
- 一些文档生成工具
- Mysql 文档生成工具
- appledoc文档生成工具
- Kindle 文档生成工具
- 软件工程文档生成工具
- StatusBar图片加载机制
- QT Creator环境升级出现的问题 ~exited with code -1073741511
- FND Debug Log(FND_LOG_MESSAGES)
- myeclipse中打断点出现Unable to install breakpoint in ...
- 找出单链表的倒数第n个元素
- LuaDoc 3.0.1 Lua源代码文档生成工具
- LBS中从数据库查询某经纬度2KM范围内的数据 - 针对大数据量的性能优化
- 15个值得开发人员关注的jQuery开发技巧和心得 .
- POJ 3051 Satellite Photographs 图的连通块,dfs即可。大水题。
- 键盘键功能键与Unicode编码对照表
- poj 1068 Parencodings
- define macro printf
- 视频监控项目中遇到的各种问题
- LoadRunner负载测试报错(-26628/-27791)