[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Documenting a C++ implemented Lua API with Doxygen - a solution
- From: Dirk Feytons <dirk.feytons@...>
- Date: Thu, 17 Mar 2011 22:06:17 +0100
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