Recently, to write API documentation for COCOS2DX-LUA projects, my idea was to write comments in the program like the Java doc approach, and generate comments by script, so that only the comments in the code need to be maintained.
Investigated, the current support of this approach has Doxygen Luadoc Ldoc, further comparison of online data decided to adopt Ldoc way
The following is an integrated approach to MAC systems
1. Ldoc GitHub address Https://github.com/stevedonovan/ldoc download code
2. Penlight library github address https://github.com/stevedonovan/Penlight download code
3. LFS GitHub address Https://github.com/keplerproject/luafilesystem download code
4. Compile LFS into lfs.so with the make command
5. Create a new folder (named Luadoc here) to copy the Ldoc folder and Ldoc.lua in the Ldoc library to it
6. Copy the lfs.so to the Luadoc
7. Copy the PL folder in the Penlight library to the Luadoc
8. Create the new config.ld content in the Luadoc folder as follows (replace XXX with the actual content file as the Lua folder or path to the file to generate the comments)
project= ' XXX ' title= ' XXXXX ' description= ' XXXXX ' file= ' XXXXX '
9. CD to Luadoc folder to execute command Lua Ldoc.lua.
The Doc folder will be generated in Luadoc open index.html you can see the comments.
More commands and usage can be found in the following articles
Http://www.cnblogs.com/jncpp/p/4230315.html
http://m.oschina.net/blog/188909
http://stevedonovan.github.io/ldoc/
In addition, because Ldoc was written in Lua, I modified some of the code in conjunction with the actual situation.
1. Ldoc_css.lua 126th Line Margin-left 18em (the original left width is too small to display)
2. Comment out 128 lines so that the total width of the page is consistent with the actual screen width
Generate API documentation for COCOS2DX-LUA projects with Ldoc