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/class.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/class.tmpl')
-rw-r--r-- | giscanner/doctemplates/Gjs/class.tmpl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/giscanner/doctemplates/Gjs/class.tmpl b/giscanner/doctemplates/Gjs/class.tmpl index 887c646b..d8433704 100644 --- a/giscanner/doctemplates/Gjs/class.tmpl +++ b/giscanner/doctemplates/Gjs/class.tmpl @@ -3,16 +3,19 @@ <synopsis><code> const ${namespace.name} = imports.gi.${namespace.name}; -let ${formatter.to_underscores(node.name).lower()} = new ${namespace.name}.${node.name}(\ +let ${formatter.to_lower_camel_case(node.name)} = new ${namespace.name}.${node.name}(\ +% if isinstance(node, (ast.Class, ast.Interface)): % if len(node.properties) > 0: { % for ix, property_ in enumerate(node.properties): -% if property_.construct or property_.construct_only or property_.writable: +% if (property_.construct or property_.construct_only) and property_.writable: <link xref='${namespace.name}.${node.name}-${property_.name}'>${property_.name.replace('-', '_')}</link>: value, % endif % endfor }\ % endif +% else: +${formatter.format_gboxed_constructor(node)}\ +% endif ); - </code></synopsis> -</%block> + </code></synopsis></%block> |