Generate API documentation for COCOS2DX-LUA projects with Ldoc

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.