FreederTeam / Freeder

An easy-to-use free feed reader
Other
5 stars 1 forks source link

doxygen for JavaScript #53

Closed tmos closed 9 years ago

tmos commented 9 years ago

It could be usefully to have a good doc for Js too, isn't it ?

Phyks commented 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:

tmos commented 9 years ago

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 :/

Phyks commented 9 years ago

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'.

eliemichel commented 9 years ago

I think the question was more "Do we need to specify any info for callback parameter since it is a usual param?"