diff options
Diffstat (limited to 'giscanner/doctemplates/Gjs')
-rw-r--r-- | giscanner/doctemplates/Gjs/class.tmpl | 18 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/constructor.tmpl | 1 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/default.tmpl | 1 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/enum.tmpl | 13 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/function.tmpl | 48 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/method.tmpl | 1 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/namespace.tmpl | 2 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/property.tmpl | 10 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/record.tmpl | 2 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/signal.tmpl | 37 | ||||
-rw-r--r-- | giscanner/doctemplates/Gjs/vfunc.tmpl | 27 |
11 files changed, 160 insertions, 0 deletions
diff --git a/giscanner/doctemplates/Gjs/class.tmpl b/giscanner/doctemplates/Gjs/class.tmpl new file mode 100644 index 00000000..887c646b --- /dev/null +++ b/giscanner/doctemplates/Gjs/class.tmpl @@ -0,0 +1,18 @@ +<%inherit file="/class.tmpl"/> +<%block name="synopsis"> + <synopsis><code> +const ${namespace.name} = imports.gi.${namespace.name}; + +let ${formatter.to_underscores(node.name).lower()} = new ${namespace.name}.${node.name}(\ +% if len(node.properties) > 0: +{ +% for ix, property_ in enumerate(node.properties): +% if property_.construct or property_.construct_only or property_.writable: + <link xref='${namespace.name}.${node.name}-${property_.name}'>${property_.name.replace('-', '_')}</link>: value, +% endif +% endfor +}\ +% endif +); + </code></synopsis> +</%block> diff --git a/giscanner/doctemplates/Gjs/constructor.tmpl b/giscanner/doctemplates/Gjs/constructor.tmpl new file mode 100644 index 00000000..a03d2825 --- /dev/null +++ b/giscanner/doctemplates/Gjs/constructor.tmpl @@ -0,0 +1 @@ +<%inherit file="./function.tmpl"/> diff --git a/giscanner/doctemplates/Gjs/default.tmpl b/giscanner/doctemplates/Gjs/default.tmpl new file mode 100644 index 00000000..b66ae926 --- /dev/null +++ b/giscanner/doctemplates/Gjs/default.tmpl @@ -0,0 +1 @@ +<%inherit file="/base.tmpl"/> diff --git a/giscanner/doctemplates/Gjs/enum.tmpl b/giscanner/doctemplates/Gjs/enum.tmpl new file mode 100644 index 00000000..35cdd439 --- /dev/null +++ b/giscanner/doctemplates/Gjs/enum.tmpl @@ -0,0 +1,13 @@ +<%inherit file="/base.tmpl"/> +<%block name="details"> +% if node.members: +<terms> +% for member in node.members: +<item> +<title><code>${node.name}.${member.name.upper()}</code></title> +${formatter.format(node, member.doc)} +</item> +% endfor +</terms> +% endif +</%block> 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> diff --git a/giscanner/doctemplates/Gjs/method.tmpl b/giscanner/doctemplates/Gjs/method.tmpl new file mode 100644 index 00000000..a03d2825 --- /dev/null +++ b/giscanner/doctemplates/Gjs/method.tmpl @@ -0,0 +1 @@ +<%inherit file="./function.tmpl"/> diff --git a/giscanner/doctemplates/Gjs/namespace.tmpl b/giscanner/doctemplates/Gjs/namespace.tmpl new file mode 100644 index 00000000..4d80c2a5 --- /dev/null +++ b/giscanner/doctemplates/Gjs/namespace.tmpl @@ -0,0 +1,2 @@ +<%! page_type="guide" %>\ +<%inherit file="/namespace.tmpl"/> diff --git a/giscanner/doctemplates/Gjs/property.tmpl b/giscanner/doctemplates/Gjs/property.tmpl new file mode 100644 index 00000000..3316a00c --- /dev/null +++ b/giscanner/doctemplates/Gjs/property.tmpl @@ -0,0 +1,10 @@ +<%inherit file="/base.tmpl"/> +<%block name="info"> + ${formatter.format_xref(node.parent, type="guide", group=page_kind)} + <title type="link" role="topic">${node.name}</title> +</%block> +<%block name="synopsis"> +<synopsis><code mime="text/x-python"> +"${node.name}" ${formatter.format_type(node.type)} : ${formatter.format_property_flags(node)} +</code></synopsis> +</%block> diff --git a/giscanner/doctemplates/Gjs/record.tmpl b/giscanner/doctemplates/Gjs/record.tmpl new file mode 100644 index 00000000..1523e0df --- /dev/null +++ b/giscanner/doctemplates/Gjs/record.tmpl @@ -0,0 +1,2 @@ +<%! page_type="guide" %>\ +<%inherit file="/base.tmpl"/> diff --git a/giscanner/doctemplates/Gjs/signal.tmpl b/giscanner/doctemplates/Gjs/signal.tmpl new file mode 100644 index 00000000..084d9743 --- /dev/null +++ b/giscanner/doctemplates/Gjs/signal.tmpl @@ -0,0 +1,37 @@ +<%inherit file="/base.tmpl"/> +<%block name="info"> + ${formatter.format_xref(node.parent, type="guide", group=page_kind)} + <title type="link" role="topic">${node.name}</title> +</%block> +<%block name="synopsis"> +<synopsis><code mime="text/x-python"> +function callback(${formatter.to_underscores(node.parent.name).lower()}, \ +% for arg in formatter.get_parameters(node): +${arg.argname}:${formatter.format_type(arg.type)}, \ +% endfor +):${formatter.format_type(node.retval.type)}; +</code></synopsis> +</%block> +<%block name="details"> +<terms> +<item> +<title><code>${formatter.to_underscores(node.parent.name).lower()}</code></title> +<p>instance of ${formatter.format_xref(node.parent)} that is emitting the signal</p> +</item> +% 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' and \ + node.retval.type.ctype is not None: +<item> +<title><code>Returns</code></title> +${formatter.format(node, node.retval.doc)} +</item> +% endif +</terms> +</%block> + diff --git a/giscanner/doctemplates/Gjs/vfunc.tmpl b/giscanner/doctemplates/Gjs/vfunc.tmpl new file mode 100644 index 00000000..1cbe511c --- /dev/null +++ b/giscanner/doctemplates/Gjs/vfunc.tmpl @@ -0,0 +1,27 @@ +<%inherit file="/base.tmpl"/> +<%block name="synopsis"> +<synopsis><code mime="text/x-gjs"> +function vfunc_${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)} { +} +</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> |