lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Tim Mensch wrote:
Anyone using Doxygen to document their Lua code? A search on this topic turned up nothing. I know there is Luadoc, but my C application is already documented with Doxygen and it would be nice to have the Lua extensions documented similarly.
Oddly enough...yes. There are Lua docs generated as part of my book:

http://www.lulu.com/content/paperback-book/navigating-the-playground-sdk%E2%84%A2/697902
Took advantage of the Doxygen LaTeX output, and poof, a book. Does 
LuaDoc do that too? :)
You can also download a PDF from http://developer.playfirst.com, if 
you're curious.
In any event, what I wrote (in Lua, no less, though wrapped in an EXE to 
allow Doxygen to call more easily) was a quick preprocessor that makes 
Lua code look like C++ code. Really it's a pretty simple hack: I only 
look for (and document) functions and global constants. When the 
preprocessor finds a "---" comment section, it removes the "---" and 
wraps it in C-style Doxygen comments, and then after the comment leaves 
just a function header, like so:
This was one approach we were brainstorming, although we were thinking 
to go to python since there are no type qualifiers in the function 
declaration.