5.1. Rest generation#
=========== filename.js =========== .. module:: filename.js
5.2. Docstring structure#
/** * My comment starts here. * This is the second line prefixed with a `*`. * ... * ... * All the follwing line will be prefixed with a `*` followed by a space. * ... * ... */
Comments line prefixed by // will be ignored. They are reserved for source code comments dedicated to developers.
5.3. Javscript functions docstring#
By default, the function directive describes a module-level function.
5.3.1. function directive#
Its purpose is to define the function prototype such as:
.. function:: loadxhtml(url, data, reqtype, mode)
If any namespace is used, we should add it in the prototype for now, until we define an appropriate directive:
.. function:: jQuery.fn.loadxhtml(url, data, reqtype, mode)
5.3.2. Function parameters#
We will define function parameters as a bulleted list, where the parameter name will be backquoted and followed by its description.
.. function:: loadxhtml(url, data, reqtype, mode) cubicweb loadxhtml plugin to make jquery handle xhtml response fetches `url` and replaces this's content with the result Its arguments are: * `url` * `mode`, how the replacement should be done (default is 'replace') Possible values are : - 'replace' to replace the node's content with the generated HTML - 'swap' to replace the node itself with the generated HTML - 'append' to append the generated HTML to the node's content
5.3.3. Optional parameter specification#
.. function:: asyncRemoteExec(fname, arg1=None, arg2=None)