summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates/Gjs/function.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/doctemplates/Gjs/function.tmpl')
-rw-r--r--giscanner/doctemplates/Gjs/function.tmpl48
1 files changed, 48 insertions, 0 deletions
diff --git a/giscanner/doctemplates/Gjs/function.tmpl b/giscanner/doctemplates/Gjs/function.tmpl
new file mode 100644
index 00000000..e0fd9612
--- /dev/null
+++ b/giscanner/doctemplates/Gjs/function.tmpl
@@ -0,0 +1,48 @@
+<%inherit file="/base.tmpl"/>
+<%block name="info">
+ ${formatter.format_xref(node.parent, type="guide", group=page_kind)}
+ <api:function>
+ <api:returns>
+ <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):
+% if arg.type.ctype == '<varargs>':
+ <api:varargs/>
+% else:
+ <api:arg>
+ <api:type>${formatter.format_type(arg.type) | x}</api:type>
+ <api:name>${formatter.format_parameter_name(node, arg)}</api:name>
+ </api:arg>
+% endif
+% endfor
+ </api:function>
+</%block>
+<%block name="synopsis">
+<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)} {
+ // Gjs wrapper for ${node.symbol}()
+}
+</code></synopsis>
+</%block>
+<%block name="details">
+% if formatter.get_parameters(node) or node.retval:
+<terms>
+% for arg in formatter.get_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':
+<item>
+<title><code>Returns</code></title>
+${formatter.format(node, node.retval.doc)}
+</item>
+% endif
+</terms>
+% endif
+</%block>