Closed tmos closed 9 years ago
:+1:
It should already be possible to generate doxygen doc for JavaScript with the current setup. All we need to do is putting doxygen docstring around the functions. For example (from PHP code):
/**
* List all available templates.
* @return An array {path, name, current} where path is the template path, name is the template name and current is true if this is the current template, false otherwise.
*/
function list_templates() {
}
ie we have to use:
/**
to begin a docstring comment (description of the function), to tell Doxygen to parse it@return
to give information on the return value, or @param
to give information about the params.I added some comments on my functions (the only without adapted comments :0, now fixed). Note that there is a lot of parameters like callback that are not commented. I don't know what kind of description we can put there :/
Updated in last commit. I added more infos about these params.
The idea is to call functions successively (chained), and passing the callback value which is the next function to call, when the function has finished.
For example: function foo(callback) { do_weird_stuff(); callback(); }
and function bar() { alert('ok'); }
.
If I do foo(bar)
, it will run foo
, execute do_weird_stuff()
and before exiting, it will chain with bar()
that will alert 'ok'.
I think the question was more "Do we need to specify any info for callback parameter since it is a usual param?"
It could be usefully to have a good doc for Js too, isn't it ?