[gobject-introspection] doctool: Move signal/vfunc templates to extend function.tmpl
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] doctool: Move signal/vfunc templates to extend function.tmpl
- Date: Sat, 2 Feb 2013 02:23:18 +0000 (UTC)
commit 911339b844bfe41b404f197924bb92a9060031ee
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Feb 1 20:41:53 2013 -0500
doctool: Move signal/vfunc templates to extend function.tmpl
giscanner/doctemplates/C/function.tmpl | 6 +++---
giscanner/doctemplates/C/signal.tmpl | 2 +-
giscanner/doctemplates/C/vfunc.tmpl | 20 +-------------------
.../DocExamples.Obj-signal-example.page | 19 +++++++++++++++++--
.../DocExamples.Obj-vfunc.page | 2 ++
5 files changed, 24 insertions(+), 25 deletions(-)
---
diff --git a/giscanner/doctemplates/C/function.tmpl b/giscanner/doctemplates/C/function.tmpl
index 4472ec5..9403698 100644
--- a/giscanner/doctemplates/C/function.tmpl
+++ b/giscanner/doctemplates/C/function.tmpl
@@ -9,7 +9,7 @@
<api:returns>
<api:type>${formatter.format_type(node.retval.type) | x}</api:type>
</api:returns>
- <api:name>${node.symbol}</api:name>
+ <api:name>${formatter.format_function_name(node)}</api:name>
% for arg in node.all_parameters:
% if arg.type.ctype == '<varargs>':
<api:varargs/>
@@ -24,13 +24,13 @@
</%block>
<%block name="synopsis">
<synopsis><code mime="text/x-csrc">
-${node.retval.type.ctype} ${node.symbol} (\
+${node.retval.type.ctype} ${formatter.format_function_name(node)} (\
% if len(node.all_parameters) == 0:
void\
% else:
% for arg, ix in zip(node.all_parameters, range(len(node.all_parameters))):
% if ix != 0:
-${' ' * (len(formatter.format_type(node.retval.type)) + len(node.symbol) + 3)}\
+${' ' * (len(formatter.format_type(node.retval.type)) + len(formatter.format_function_name(node)) + 3)}\
% endif
% if arg.type.ctype == '<varargs>':
...\
diff --git a/giscanner/doctemplates/C/signal.tmpl b/giscanner/doctemplates/C/signal.tmpl
index e3eb051..20e28e1 100644
--- a/giscanner/doctemplates/C/signal.tmpl
+++ b/giscanner/doctemplates/C/signal.tmpl
@@ -1,4 +1,4 @@
-<%inherit file="/base.tmpl"/>
+<%inherit file="./function.tmpl"/>
<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
<title type="link" role="topic">${node.name}</title>
diff --git a/giscanner/doctemplates/C/vfunc.tmpl b/giscanner/doctemplates/C/vfunc.tmpl
index 902b886..85427de 100644
--- a/giscanner/doctemplates/C/vfunc.tmpl
+++ b/giscanner/doctemplates/C/vfunc.tmpl
@@ -1,22 +1,4 @@
-<%inherit file="/base.tmpl"/>
+<%inherit file="./function.tmpl"/>
<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="vfunc"/>
</%block>
-<%block name="synopsis">
-<synopsis><code mime="text/x-csrc">
-</code></synopsis>
-</%block>
-<%block name="details">
-% if node.parameters or node.retval:
-<dl>
-% for arg, ix in zip(node.parameters, range(len(node.parameters))):
-<dt><p>${arg.argname} :</p></dt>
-<dd>${formatter.format(node, arg.doc)}</dd>
-% endfor
-% if node.retval:
-<dt><p>Returns :</p></dt>
-<dd>${formatter.format(node, node.retval.doc)}</dd>
-% endif
-</dl>
-% endif
-</%block>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page
index 5b54651..8502865 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page
@@ -13,7 +13,12 @@
</info>
<title>DocExamples.Obj::signal-example</title>
-
+<synopsis><code mime="text/x-csrc">
+void signal-example (guint int_param,
+ guint float_param,
+ gpointer pointer_param);
+</code></synopsis>
+
<p>This is an example of how to document a signal.</p>
@@ -21,7 +26,17 @@
<p>Since 0.99</p>
-
+<dl>
+<dt><p>int_param :</p></dt>
+<dd><p>a parameter of type int</p></dd>
+<dt><p>float_param :</p></dt>
+<dd><p>a parameter of type float</p></dd>
+<dt><p>pointer_param :</p></dt>
+<dd><p>A pointer to @obj's thingy -- pass <code>int_param</code> if you really want to.</p></dd>
+<dt><p>Returns :</p></dt>
+<dd></dd>
+</dl>
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page
index c06c5e7..6a71a87 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page
@@ -13,6 +13,8 @@
<title>DocExamples.Obj::vfunc</title>
<synopsis><code mime="text/x-csrc">
+void vfunc (DocExamplesObj* self,
+ gint first_arg);
</code></synopsis>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]