diff options
author | Giovanni Campagna <gcampagna@src.gnome.org> | 2014-02-19 16:19:53 +0100 |
---|---|---|
committer | Giovanni Campagna <gcampagna@src.gnome.org> | 2014-02-20 02:07:48 +0100 |
commit | 75d25b7f47542aa003c92ce576b6e82bae66aec9 (patch) | |
tree | fe44b2083492e76f8bda7d903db169530dcba2b4 /giscanner/doctemplates/Gjs/function.tmpl | |
parent | bd4608b6c761209bca8362bd5524e4dbe781e532 (diff) | |
download | gobject-introspection-75d25b7f47542aa003c92ce576b6e82bae66aec9.tar.gz |
doctool: improve Gjs documentation
- Add documentation for structures, fields, constants and
callbacks
- Improve the synopsis for interfaces to have prerequisites
and known implementations
- Respect gjs constraints for field writability
- Format in and out parameters for callables according to GJS
conventions
- Format property names according to the GJS API
- Show boxed constructors according to how they can be used
in the gjs API
https://bugzilla.gnome.org/show_bug.cgi?id=724735
Diffstat (limited to 'giscanner/doctemplates/Gjs/function.tmpl')
-rw-r--r-- | giscanner/doctemplates/Gjs/function.tmpl | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/giscanner/doctemplates/Gjs/function.tmpl b/giscanner/doctemplates/Gjs/function.tmpl index e0fd9612..012978ac 100644 --- a/giscanner/doctemplates/Gjs/function.tmpl +++ b/giscanner/doctemplates/Gjs/function.tmpl @@ -6,7 +6,7 @@ <api:type>${formatter.format_type(node.retval.type) | x}</api:type> </api:returns> <api:name>${node.symbol}</api:name> -% for arg in formatter.get_parameters(node): +% for arg in formatter.get_in_parameters(node): % if arg.type.ctype == '<varargs>': <api:varargs/> % else: @@ -19,30 +19,29 @@ </api:function> </%block> <%block name="synopsis"> -<synopsis><code mime="text/x-gjs"> + <synopsis><code mime="text/x-gjs"> function \ ${node.name}(\ -${', '.join('%s:%s' % (arg.argname, formatter.format_type(arg.type)) for arg in formatter.get_parameters(node))}\ -):${formatter.format_type(node.retval.type)} { +${', '.join('%s: %s' % (arg.argname, formatter.format_type(arg.type, True)) for arg in formatter.get_in_parameters(node))}\ +): ${formatter.format_out_parameters(node)} { // Gjs wrapper for ${node.symbol}() } -</code></synopsis> -</%block> + </code></synopsis></%block> <%block name="details"> -% if formatter.get_parameters(node) or node.retval: +% if formatter.has_any_parameters(node): <terms> -% for arg in formatter.get_parameters(node): +% for arg in formatter.get_in_parameters(node): <item> <title><code>${arg.argname}</code></title> ${formatter.format(node, arg.doc)} </item> % endfor -% if node.retval and node.retval.type.ctype != 'void': +% for arg in formatter.get_out_parameters(node): <item> -<title><code>Returns</code></title> -${formatter.format(node, node.retval.doc)} +<title><code>${(arg.argname + ' (out)') if arg.direction == 'inout' else arg.argname}</code></title> +${formatter.format(node, arg.doc)} </item> -% endif +% endfor </terms> % endif </%block> |