lua-users home
lua-l archive

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


On Wed, Mar 16, 2011 at 10:56, Carsten Fuchs <CarstenFuchs@t-online.de> wrote:
> Dear Lua folks,
>
> we've long been looking for a solution for documenting our C++ implemented
> Lua API (the Lua-based scripting API of our game engine Cafu,
> http://www.cafu.de), preferably using Doxygen, and now that we've found it,
> we would like to share it:
[snip]

FWIW: I've had good success with a slightly modified LuaDoc on our C
binding code that had LuaDoc-style comments wrapped in C comment
blocks.
This is (ab)using the fact that LuaDoc takes a naive approach at
extracting the documentation: it simply searches for the marker
indicating the start of documentation and ignores all the rest.

/*
------------------
-- This is my module doing ...
------------------
module("mymodule")
*/

/*
------------------
-- My foo function.
-- @name foo
-- @type function
-- @param bar Whether you want bar (boolean). Optional; default is false.
------------------
function foo(bar)
*/
static int mymodule_foo(lua_State *L)
{
  ...
}


-- 
Dirk