summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2012-02-20 13:44:00 +0100
committerTomeu Vizoso <tomeu.vizoso@collabora.com>2012-02-20 13:44:00 +0100
commit8c7e27b90ceb176d463399735220df806ee7f35f (patch)
tree27e6669d5e9dedf0c7b4e62337e8364c2140a865
parent99109f5a8ae11b7f182da497ca7b2d1dc3d11920 (diff)
downloadgobject-introspection-8c7e27b90ceb176d463399735220df806ee7f35f.tar.gz
g-ir-doc-tool: Move constructor example to follow the class doc body
-rw-r--r--giscanner/mallard-Python-class.tmpl27
-rw-r--r--tests/doctool/GIRepository-2.0-Python-expected/GIRepository.Repository.page9
2 files changed, 21 insertions, 15 deletions
diff --git a/giscanner/mallard-Python-class.tmpl b/giscanner/mallard-Python-class.tmpl
index 5437fcd4..489a4295 100644
--- a/giscanner/mallard-Python-class.tmpl
+++ b/giscanner/mallard-Python-class.tmpl
@@ -10,19 +10,10 @@
</info>
<title>${namespace.name}.${node.name}</title>
${formatter.format(node.doc)}
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
- <synopsis ui:expanded="no">
- <title>Hierarchy</title>
- <tree>
- <item>
- <code>GObject.Object</code>
- </item>
- </tree>
- </synopsis>
- <p>Constructor</p>
+
<synopsis><code>
+from gi.repository import ${namespace.name}
+
${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(\
% for property_, ix in zip(node.properties, range(len(node.properties))):
% if property_.construct or property_.construct_only or property_.writable:
@@ -34,6 +25,18 @@ ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(
% endfor
)\
</code></synopsis>
+
+% if node.version:
+<p>Since ${node.version}</p>
+% endif
+ <synopsis ui:expanded="no">
+ <title>Hierarchy</title>
+ <tree>
+ <item>
+ <code>GObject.Object</code>
+ </item>
+ </tree>
+ </synopsis>
<links type="topic" ui:expanded="yes"
api:type="function" api:mime="text/x-python"
groups="method" style="linklist">
diff --git a/tests/doctool/GIRepository-2.0-Python-expected/GIRepository.Repository.page b/tests/doctool/GIRepository-2.0-Python-expected/GIRepository.Repository.page
index a5dd47ba..bf38345a 100644
--- a/tests/doctool/GIRepository-2.0-Python-expected/GIRepository.Repository.page
+++ b/tests/doctool/GIRepository-2.0-Python-expected/GIRepository.Repository.page
@@ -10,6 +10,12 @@
</info>
<title>GIRepository.Repository</title>
+
+ <synopsis><code>
+from gi.repository import GIRepository
+
+repository = GIRepository.Repository() </code></synopsis>
+
<synopsis ui:expanded="no">
<title>Hierarchy</title>
<tree>
@@ -18,9 +24,6 @@
</item>
</tree>
</synopsis>
- <p>Constructor</p>
- <synopsis><code>
-repository = GIRepository.Repository() </code></synopsis>
<links type="topic" ui:expanded="yes"
api:type="function" api:mime="text/x-python"
groups="method" style="linklist">