Luadoc is a Lua source code file generation tool.
Project address: http://luadoc.luaforge.net
Current version: 3.0.1
Luadoc depends on luafilesystem and lualogging, we can directly download Lua for Windows (http://code.google.com/p/luaforwindows/), this is the integration package with luadoc, we can see in the Lua for Windows Directory luadoc_start.bat file, after opening the file, it is as follows:
1
|
|
Lua.exe "% lua_dev % \ Lua \ luadoc_start.lua" % * |
This is a document automatically generated by batch processing. The luadoc_start.lua command is as follows:
1
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 |
The luadoc Comments start with three consecutive minus signs. The supported labels include: @ author <text>
@ Copyright <text> @ field @ Param <word> <text> @ release <text> @ return <text> @ See <text> @ usage <text> and three luadoc automatically derived tags, you can manually specify to overwrite the derived value: @ class <word> @ description
@ Name <word>
Run the following command to test the luadoc usage and create a new Lua file. The test code is as follows:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
|
--- Test table
-- @ Class table
-- @ Name testtable
-- @ Field Testa test field
-- @ Field testb test field B
Testtable =
{
Testa = nil,
Testb = nil,
}
--- Test functions
-- @ Param a parameter
-- @ Param B parameter B
-- @ Return returns 1
-- @ Usage testfun (1, 2)
-- @ See testtable
Function testfun (A, B)
Return 1
End |
In the Lua project folder, create a new batch. The content is as follows:
1
|
|
Lua.exe "% lua_dev % \ Lua \ luadoc_start.lua"-d "Docs "* |
The Lua source code is automatically generated and saved in the docs directory. If there is no error in the production process, open index.html in the docs. The effect is shown in:
Click in, as shown in:
References:1. luadoc Manual
Http://keplerproject.github.com/luadoc/manual.html2.use luadocto generate luafile for Windows
Http://www.cppblog.com/tx7do/archive/2010/07/25/121209.html