[gobject-introspection] doctool: Use a base template for all pages
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] doctool: Use a base template for all pages
- Date: Sat, 2 Feb 2013 02:21:37 +0000 (UTC)
commit 9c68ba7c6f8b6b7367ccad1877d28cd526045961
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jan 31 11:46:13 2013 -0500
doctool: Use a base template for all pages
Makefile-giscanner.am | 1 +
giscanner/doctemplates/C/mallard-C-class.tmpl | 22 +++++-------------
giscanner/doctemplates/C/mallard-C-default.tmpl | 12 +---------
giscanner/doctemplates/C/mallard-C-enum.tmpl | 14 +----------
giscanner/doctemplates/C/mallard-C-function.tmpl | 23 ++++++-------------
giscanner/doctemplates/C/mallard-C-namespace.tmpl | 14 +++--------
giscanner/doctemplates/C/mallard-C-property.tmpl | 14 ++---------
giscanner/doctemplates/C/mallard-C-record.tmpl | 13 +----------
giscanner/doctemplates/C/mallard-C-signal.tmpl | 16 +++----------
giscanner/doctemplates/C/mallard-C-vfunc.tmpl | 23 ++++++-------------
.../doctemplates/Python/mallard-Python-class.tmpl | 22 ++++--------------
.../Python/mallard-Python-default.tmpl | 12 +---------
.../doctemplates/Python/mallard-Python-enum.tmpl | 15 ++----------
.../Python/mallard-Python-function.tmpl | 22 ++++++-------------
.../Python/mallard-Python-namespace.tmpl | 20 ++++++-----------
.../Python/mallard-Python-property.tmpl | 17 +++++---------
.../doctemplates/Python/mallard-Python-record.tmpl | 14 +----------
.../doctemplates/Python/mallard-Python-signal.tmpl | 20 ++++++-----------
.../doctemplates/Python/mallard-Python-vfunc.tmpl | 22 ++++--------------
giscanner/doctemplates/mallard-base.tmpl | 23 ++++++++++++++++++++
giscanner/mallardwriter.py | 5 ++-
.../DocExamples.Callback.page | 9 +++++++-
.../DocExamples.Enum.page | 10 +++++++-
.../DocExamples.Obj-property-example.page | 10 +++++++-
.../DocExamples.Obj-signal-example.page | 12 +++++++--
.../DocExamples.Obj-vfunc.page | 12 ++++++++-
.../DocExamples.Obj.method.page | 14 +++++++++--
.../DocExamples.Obj.new.page | 10 +++++++-
.../DocExamples.Obj.page | 15 ++++++++++--
.../DocExamples.Obj.static_method.page | 12 ++++++++-
.../DocExamples.ObjClass.page | 12 +++++++--
.../DocExamples.array_function.page | 12 ++++++++-
.../DocExamples.callback_function.page | 12 ++++++++-
.../doctool/DocExamples-1.0-C-expected/index.page | 7 ++++++
.../DocExamples.Callback.page | 9 +++++++-
.../DocExamples.Enum.page | 9 ++++++-
.../DocExamples.Obj-property-example.page | 10 +++++++-
.../DocExamples.Obj-signal-example.page | 10 +++++++-
.../DocExamples.Obj-vfunc.page | 16 ++++++++++---
.../DocExamples.Obj.method.page | 13 +++++++++-
.../DocExamples.Obj.page | 18 +++++++++++----
.../DocExamples.Obj.static_method.page | 11 ++++++++-
.../DocExamples.array_function.page | 11 ++++++++-
.../DocExamples.callback_function.page | 11 ++++++++-
.../DocExamples-1.0-Python-expected/index.page | 13 ++++++++--
45 files changed, 335 insertions(+), 287 deletions(-)
---
diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am
index 9865ece..35eac1d 100644
--- a/Makefile-giscanner.am
+++ b/Makefile-giscanner.am
@@ -54,6 +54,7 @@ pkgpyexec_PYTHON = \
templatedir = $(pkglibdir)
nobase_template_DATA = \
+ giscanner/doctemplates/mallard-base.tmpl \
giscanner/doctemplates/C/mallard-C-class.tmpl \
giscanner/doctemplates/C/mallard-C-constructor.tmpl \
giscanner/doctemplates/C/mallard-C-default.tmpl \
diff --git a/giscanner/doctemplates/C/mallard-C-class.tmpl b/giscanner/doctemplates/C/mallard-C-class.tmpl
index 3a20844..b1be35e 100644
--- a/giscanner/doctemplates/C/mallard-C-class.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-class.tmpl
@@ -1,18 +1,8 @@
-<?xml version="1.0"?>
-<page id="${node.namespace.name}.${node.name}"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:api="http://projectmallard.org/experimental/api/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="index" group="class"/>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
+<%! page_type="guide" %>\
+<%inherit file="mallard-base.tmpl"/>
+<%block name="content">
+${parent.content()}
+${self.since_version()}
<synopsis ui:expanded="no">
<title>Hierarchy</title>
<tree>
@@ -45,4 +35,4 @@ ${formatter.format(node, node.doc)}
<links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
-</page>
+</%block>
diff --git a/giscanner/doctemplates/C/mallard-C-default.tmpl b/giscanner/doctemplates/C/mallard-C-default.tmpl
index d2c4105..991f29b 100644
--- a/giscanner/doctemplates/C/mallard-C-default.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-default.tmpl
@@ -1,11 +1 @@
-<?xml version="1.0"?>
-<page id="${namespace.name}.${node.name}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-</page>
+<%inherit file="mallard-base.tmpl"/>
diff --git a/giscanner/doctemplates/C/mallard-C-enum.tmpl b/giscanner/doctemplates/C/mallard-C-enum.tmpl
index 7283366..cfe71c1 100644
--- a/giscanner/doctemplates/C/mallard-C-enum.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-enum.tmpl
@@ -1,12 +1,2 @@
-<?xml version="1.0"?>
-<page id="${node.namespace.name}.${node.name}"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="index"/>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-</page>
+<%! page_type="guide" %>\
+<%inherit file="mallard-base.tmpl"/>
diff --git a/giscanner/doctemplates/C/mallard-C-function.tmpl b/giscanner/doctemplates/C/mallard-C-function.tmpl
index d433aa5..f93fc31 100644
--- a/giscanner/doctemplates/C/mallard-C-function.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-function.tmpl
@@ -1,11 +1,5 @@
-<?xml version="1.0"?>
-<page id="${page_id}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:api="http://projectmallard.org/experimental/api/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="info">
% if node.parent is not None:
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="${page_style}"/>
% else:
@@ -33,8 +27,8 @@
% endif
% endfor
</api:function>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+</%block>
+<%block name="content">
<synopsis><code mime="text/x-csrc">
${node.retval.type.ctype} ${node.symbol} (\
% if node.is_method:
@@ -64,8 +58,7 @@ ${formatter.format_type(arg.type) | x} ${arg.argname}\
%endif
% endfor
</code></synopsis>
-${formatter.format(node, node.doc)}
-
+${parent.content()}
% if node.parameters or node.retval:
<table>
% for arg, ix in zip(node.parameters, range(len(node.parameters))):
@@ -82,7 +75,5 @@ ${formatter.format(node, node.doc)}
% endif
</table>
% endif
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
-</page>
+${self.since_version()}
+</%block>
diff --git a/giscanner/doctemplates/C/mallard-C-namespace.tmpl b/giscanner/doctemplates/C/mallard-C-namespace.tmpl
index 39d0261..372cd33 100644
--- a/giscanner/doctemplates/C/mallard-C-namespace.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-namespace.tmpl
@@ -1,12 +1,6 @@
-<?xml version="1.0"?>
-<page id="index"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+<%! page_type="guide" %>\
+<%inherit file="mallard-base.tmpl"/>
+<%block name="content">
<links type="topic" ui:expanded="yes" groups="class" style="linklist">
<title>Classes</title>
</links>
@@ -16,4 +10,4 @@
<links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
-</page>
+</%block>
diff --git a/giscanner/doctemplates/C/mallard-C-property.tmpl b/giscanner/doctemplates/C/mallard-C-property.tmpl
index a253160..cceb62d 100644
--- a/giscanner/doctemplates/C/mallard-C-property.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-property.tmpl
@@ -1,13 +1,5 @@
-<?xml version="1.0"?>
-<page id="${namespace.name}.${node.name}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
<title type="link" role="topic">${node.name}</title>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-</page>
+</%block>
diff --git a/giscanner/doctemplates/C/mallard-C-record.tmpl b/giscanner/doctemplates/C/mallard-C-record.tmpl
index 7283366..991f29b 100644
--- a/giscanner/doctemplates/C/mallard-C-record.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-record.tmpl
@@ -1,12 +1 @@
-<?xml version="1.0"?>
-<page id="${node.namespace.name}.${node.name}"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="index"/>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-</page>
+<%inherit file="mallard-base.tmpl"/>
diff --git a/giscanner/doctemplates/C/mallard-C-signal.tmpl b/giscanner/doctemplates/C/mallard-C-signal.tmpl
index 49ee985..cceb62d 100644
--- a/giscanner/doctemplates/C/mallard-C-signal.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-signal.tmpl
@@ -1,13 +1,5 @@
-<?xml version="1.0"?>
-<page id="${namespace.name}.${node.name}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="${namespace.name}.${node.parent.name}" group="signal"/>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="info">
+ <link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
<title type="link" role="topic">${node.name}</title>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-</page>
+</%block>
diff --git a/giscanner/doctemplates/C/mallard-C-vfunc.tmpl b/giscanner/doctemplates/C/mallard-C-vfunc.tmpl
index 3363ea8..b27b2ce 100644
--- a/giscanner/doctemplates/C/mallard-C-vfunc.tmpl
+++ b/giscanner/doctemplates/C/mallard-C-vfunc.tmpl
@@ -1,18 +1,11 @@
-<?xml version="1.0"?>
-<page id="${page_id}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:api="http://projectmallard.org/experimental/api/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="vfunc"/>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+</%block>
+<%block name="content">
<synopsis><code mime="text/x-csrc">
</code></synopsis>
-${formatter.format(node, node.doc)}
-
+${parent.content()}
% if node.parameters or node.retval:
<table>
% for arg, ix in zip(node.parameters, range(len(node.parameters))):
@@ -29,7 +22,5 @@ ${formatter.format(node, node.doc)}
% endif
</table>
% endif
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
-</page>
+${self.since_version()}
+</%block>
diff --git a/giscanner/doctemplates/Python/mallard-Python-class.tmpl b/giscanner/doctemplates/Python/mallard-Python-class.tmpl
index 800d241..3f0d67a 100644
--- a/giscanner/doctemplates/Python/mallard-Python-class.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-class.tmpl
@@ -1,16 +1,6 @@
-<?xml version="1.0"?>
-<page id="${node.namespace.name}.${node.name}"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:api="http://projectmallard.org/experimental/api/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="index" group="class"/>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-
+<%inherit file="mallard-base.tmpl"/>
+<%block name="content">
+ ${parent.content()}
<synopsis><code>
from gi.repository import ${namespace.name}
@@ -26,9 +16,7 @@ ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(
)\
</code></synopsis>
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
+ ${self.since_version()}
<synopsis>
<title>Hierarchy</title>
<tree>
@@ -63,4 +51,4 @@ ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(
<links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
-</page>
+</%block>
diff --git a/giscanner/doctemplates/Python/mallard-Python-default.tmpl b/giscanner/doctemplates/Python/mallard-Python-default.tmpl
index 1d20210..991f29b 100644
--- a/giscanner/doctemplates/Python/mallard-Python-default.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-default.tmpl
@@ -1,11 +1 @@
-<?xml version="1.0"?>
-<page id="${page_id}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- </info>
- <title>${formatter.format_page_name(node)}</title>
-${formatter.format(node, node.doc)}
-</page>
+<%inherit file="mallard-base.tmpl"/>
diff --git a/giscanner/doctemplates/Python/mallard-Python-enum.tmpl b/giscanner/doctemplates/Python/mallard-Python-enum.tmpl
index c1a4d8c..09f4d9a 100644
--- a/giscanner/doctemplates/Python/mallard-Python-enum.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-enum.tmpl
@@ -1,13 +1,5 @@
-<?xml version="1.0"?>
-<page id="${node.namespace.name}.${node.name}"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="index"/>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="content">
${formatter.format(node, node.doc)}
% if node.members:
<table>
@@ -19,5 +11,4 @@
% endfor
</table>
% endif
-
-</page>
+</%block>
diff --git a/giscanner/doctemplates/Python/mallard-Python-function.tmpl b/giscanner/doctemplates/Python/mallard-Python-function.tmpl
index 1976a1c..683ca83 100644
--- a/giscanner/doctemplates/Python/mallard-Python-function.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-function.tmpl
@@ -1,11 +1,5 @@
-<?xml version="1.0"?>
-<page id="${page_id}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:api="http://projectmallard.org/experimental/api/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="info">
% if node.parent is not None:
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="${page_style}"/>
% else:
@@ -33,8 +27,8 @@
% endif
% endfor
</api:function>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+</%block>
+<%block name="content">
<synopsis><code mime="text/x-python">
% if len(node.parameters) != 0:
@accepts(\
@@ -51,7 +45,7 @@ ${', '.join((arg.argname for arg in node.parameters))}\
):
# Python wrapper for ${node.symbol}()
</code></synopsis>
-${formatter.format(node, node.doc)}
+${parent.content()}
% if node.parameters or node.retval:
<table>
@@ -69,7 +63,5 @@ ${formatter.format(node, node.doc)}
% endif
</table>
% endif
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
-</page>
+${self.since_version()}
+</%block>
diff --git a/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl b/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl
index 97bd713..372cd33 100644
--- a/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl
@@ -1,19 +1,13 @@
-<?xml version="1.0"?>
-<page id="index"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- </info>
- <title>${formatter.format_page_name(node)}</title>
- <links type="topic" ui:expanded="yes" groups="class">
+<%! page_type="guide" %>\
+<%inherit file="mallard-base.tmpl"/>
+<%block name="content">
+ <links type="topic" ui:expanded="yes" groups="class" style="linklist">
<title>Classes</title>
</links>
- <links type="topic" ui:expanded="yes" groups="function">
+ <links type="topic" ui:expanded="yes" groups="function" style="linklist">
<title>Functions</title>
</links>
- <links type="topic" ui:expanded="yes" groups="#first #default #last">
+ <links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
-</page>
+</%block>
diff --git a/giscanner/doctemplates/Python/mallard-Python-property.tmpl b/giscanner/doctemplates/Python/mallard-Python-property.tmpl
index 7f4138c..db78f2b 100644
--- a/giscanner/doctemplates/Python/mallard-Python-property.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-property.tmpl
@@ -1,16 +1,11 @@
-<?xml version="1.0"?>
-<page id="${namespace.name}.${node.parent.name}-${node.name}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="property"/>
<title type="link" role="topic">${node.name}</title>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+</%block>
+<%block name="content">
<synopsis><code mime="text/x-python">
"${node.name}" ${formatter.format_type(node.type)} : ${formatter.format_property_flags(node)}
</code></synopsis>
-${formatter.format(node, node.doc)}
-</page>
+${parent.content()}
+</%block>
diff --git a/giscanner/doctemplates/Python/mallard-Python-record.tmpl b/giscanner/doctemplates/Python/mallard-Python-record.tmpl
index 43bea04..cfe71c1 100644
--- a/giscanner/doctemplates/Python/mallard-Python-record.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-record.tmpl
@@ -1,12 +1,2 @@
-<?xml version="1.0"?>
-<page id="${node.namespace.name}.${node.name}"
- type="guide"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="index"/>
- </info>
- <title>${formatter.format_page_name(node)}</title>
- <p>${node.doc}</p>
-</page>
+<%! page_type="guide" %>\
+<%inherit file="mallard-base.tmpl"/>
diff --git a/giscanner/doctemplates/Python/mallard-Python-signal.tmpl b/giscanner/doctemplates/Python/mallard-Python-signal.tmpl
index 8dda89b..a430d9b 100644
--- a/giscanner/doctemplates/Python/mallard-Python-signal.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-signal.tmpl
@@ -1,14 +1,9 @@
-<?xml version="1.0"?>
-<page id="${namespace.name}.${node.parent.name}-${node.name}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="info">
<link type="guide" xref="${namespace.name}.${node.parent.name}" group="signal"/>
<title type="link" role="topic">${node.name}</title>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+</%block>
+<%block name="content">
<synopsis><code mime="text/x-python">
def callback(${formatter.to_underscores(node.parent.name).lower()}, \
% for arg, ix in zip(node.parameters, range(len(node.parameters))):
@@ -46,7 +41,6 @@ ${formatter.format(node, node.doc)}
</tr>
% endif
</table>
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
-</page>
+${self.since_version()}
+</%block>
+
diff --git a/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl b/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
index 86dc685..65af005 100644
--- a/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
+++ b/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl
@@ -1,15 +1,5 @@
-<?xml version="1.0"?>
-<page id="${page_id}"
- type="topic"
- style="${page_style}"
- xmlns="http://projectmallard.org/1.0/"
- xmlns:api="http://projectmallard.org/experimental/api/"
- xmlns:ui="http://projectmallard.org/experimental/ui/">
- <info>
- <link type="guide" xref="${namespace.name}.${node.parent.name}" group="vfunc"/>
- <title type="link" role="topic">${node.name}</title>
- </info>
- <title>${formatter.format_page_name(node)}</title>
+<%inherit file="mallard-base.tmpl"/>
+<%block name="content">
<synopsis><code mime="text/x-python">
% if len(node.parameters) != 0:
@accepts(\
@@ -22,7 +12,7 @@ do_${node.name}(self, \
${', '.join((arg.argname for arg in node.parameters))}\
):
</code></synopsis>
-${formatter.format(node, node.doc)}
+${parent.content()}
% if node.parameters or node.retval:
<table>
@@ -40,7 +30,5 @@ ${formatter.format(node, node.doc)}
% endif
</table>
% endif
-% if node.version:
-<p>Since ${node.version}</p>
-% endif
-</page>
+${self.since_version()}
+</%block>
diff --git a/giscanner/doctemplates/mallard-base.tmpl b/giscanner/doctemplates/mallard-base.tmpl
new file mode 100644
index 0000000..07eb446
--- /dev/null
+++ b/giscanner/doctemplates/mallard-base.tmpl
@@ -0,0 +1,23 @@
+<%! page_type="topic" %>\
+<?xml version="1.0"?>
+<page id="${page_id}"
+ type="${self.attr.page_type}"
+ style="${page_style}"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/experimental/ui/">
+ <info>
+ <%block name="info">
+ <link type="guide" xref="index"/>
+ </%block>
+ </info>
+ <title><%block name="title">${formatter.format_page_name(node)}</%block></title>
+ <%block name="content">
+ ${formatter.format(node, node.doc)}
+ </%block>
+ <%def name="since_version()">
+ % if node.version:
+ <p>Since ${node.version}</p>
+ % endif
+ </%def>
+</page>
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py
index ccd65f0..f40bf88 100644
--- a/giscanner/mallardwriter.py
+++ b/giscanner/mallardwriter.py
@@ -462,9 +462,10 @@ class MallardWriter(object):
else:
srcdir = os.path.dirname(__file__)
- template_dir = os.path.join(srcdir, 'doctemplates', self._language)
+ template_dir = os.path.join(srcdir, 'doctemplates')
+ language_dir = os.path.join(template_dir, self._language)
- return TemplateLookup(directories=[template_dir],
+ return TemplateLookup(directories=[template_dir, language_dir],
module_directory=tempfile.mkdtemp(),
output_encoding='utf-8')
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Callback.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Callback.page
index b79b93a..c2c171b 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Callback.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Callback.page
@@ -3,9 +3,16 @@
type="topic"
style="default"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.Callback</title>
-
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Enum.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Enum.page
index 56ebc4b..06fec31 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Enum.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Enum.page
@@ -3,10 +3,16 @@
type="guide"
style="enum"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
- <link type="guide" xref="index"/>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.Enum</title>
-<p>This is an example to document an enumeration.</p>
+
+ <p>This is an example to document an enumeration.</p>
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page
index fde0ffb..465c018 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page
@@ -1,13 +1,19 @@
<?xml version="1.0"?>
-<page id="DocExamples.property-example"
+<page id="DocExamples.Obj-property-example"
type="topic"
style="property"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="property"/>
<title type="link" role="topic">property-example</title>
+
</info>
<title>DocExamples.Obj:property-example</title>
-<p>This is an example of how to document a property.</p>
+
+ <p>This is an example of how to document a property.</p>
+
+
</page>
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 7f63fa4..7d40713 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
@@ -1,13 +1,19 @@
<?xml version="1.0"?>
-<page id="DocExamples.signal-example"
+<page id="DocExamples.Obj-signal-example"
type="topic"
style="signal"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
- <link type="guide" xref="DocExamples.Obj" group="signal"/>
+
+ <link type="guide" xref="DocExamples.Obj" group="property"/>
<title type="link" role="topic">signal-example</title>
+
</info>
<title>DocExamples.Obj::signal-example</title>
-<p>This is an example of how to document a signal.</p>
+
+ <p>This is an example of how to document a signal.</p>
+
+
</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 c9b4766..23a7c65 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
@@ -6,13 +6,17 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="vfunc"/>
+
</info>
<title>DocExamples.Obj::vfunc</title>
+
<synopsis><code mime="text/x-csrc">
</code></synopsis>
-<p>This is an example of how to document a vfunc.</p>
+ <p>This is an example of how to document a vfunc.</p>
+
<table>
<tr>
<td><p>first_arg :</p></td>
@@ -23,5 +27,9 @@
<td></td>
</tr>
</table>
-<p>Since 0.99</p>
+
+ <p>Since 0.99</p>
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
index 2015098..4d2f6cd 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="method"/>
<api:function>
<api:returns>
@@ -37,8 +38,10 @@
<api:name>string</api:name>
</api:arg>
</api:function>
+
</info>
<title>doc_examples_obj_method</title>
+
<synopsis><code mime="text/x-csrc">
gboolean doc_examples_obj_method (DocExamplesObj *self,
gint first_arg,
@@ -47,9 +50,10 @@ gint first_arg,
gpointer pointer_arg,
gchar* string);
</code></synopsis>
-<p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was
-created with <link xref="DocExamples.Obj.new">doc_examples_obj_new</link>.</p><p>This should be a %FALSEALARM.</p>
+ <p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was
+created with <link xref="DocExamples.Obj.new">doc_examples_obj_new</link>.</p><p>This should be a %FALSEALARM.</p>
+
<table>
<tr>
<td><p>first_arg :</p></td>
@@ -76,5 +80,9 @@ created with <link xref="DocExamples.Obj.new">doc_examples_obj_new</link>.</p><p
<td><p>Either <code>FALSE</code> or something <code>FALSE</code>-y.</p></td>
</tr>
</table>
-<p>Since 0.99</p>
+
+ <p>Since 0.99</p>
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page
index 0e010cf..0f8c297 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="constructor"/>
<api:function>
<api:returns>
@@ -13,17 +14,24 @@
</api:returns>
<api:name>doc_examples_obj_new</api:name>
</api:function>
+
</info>
<title>doc_examples_obj_new</title>
+
<synopsis><code mime="text/x-csrc">
DocExamplesObj* doc_examples_obj_new (void);
</code></synopsis>
-
+
+
<table>
<tr>
<td><p>Returns :</p></td>
<td></td>
</tr>
</table>
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page
index 6014906..9937b79 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page
@@ -6,11 +6,18 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
- <link type="guide" xref="index" group="class"/>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.Obj</title>
-<p>This is an example of how to document a class</p><p>This class has a signal: <link xref="DocExamples.Obj-signal-example">DocExamples.Obj::signal-example</link>.</p><p>And also has a property: <link xref="DocExamples.Obj-property-example">DocExamples.Obj:property-example</link>.</p>
-<p>Since 0.99</p>
+
+
+ <p>This is an example of how to document a class</p><p>This class has a signal: <link xref="DocExamples.Obj-signal-example">DocExamples.Obj::signal-example</link>.</p><p>And also has a property: <link xref="DocExamples.Obj-property-example">DocExamples.Obj:property-example</link>.</p>
+
+
+ <p>Since 0.99</p>
+
<synopsis ui:expanded="no">
<title>Hierarchy</title>
<tree>
@@ -43,4 +50,6 @@
<links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.static_method.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.static_method.page
index ebf23d5..358a220 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.static_method.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.static_method.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="function"/>
<api:function>
<api:returns>
@@ -17,14 +18,17 @@
<api:name>out_arg</api:name>
</api:arg>
</api:function>
+
</info>
<title>doc_examples_obj_static_method</title>
+
<synopsis><code mime="text/x-csrc">
gboolean doc_examples_obj_static_method (gint* out_arg);
</code></synopsis>
-<p>This is an example of a function with an out argument
-and a return value.</p>
+ <p>This is an example of a function with an out argument
+and a return value.</p>
+
<table>
<tr>
<td><p>out_arg :</p></td>
@@ -35,4 +39,8 @@ and a return value.</p>
<td><p><code>TRUE</code> if <code>out_arg</code> is valid, <code>FALSE</code> otherwise</p></td>
</tr>
</table>
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page
index c8e4375..cd8021b 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page
@@ -1,12 +1,18 @@
<?xml version="1.0"?>
<page id="DocExamples.ObjClass"
- type="guide"
+ type="topic"
style="record"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
- <link type="guide" xref="index"/>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.ObjClass</title>
-
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.array_function.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.array_function.page
index 2b19e8d..f24da60 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.array_function.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.array_function.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="index" group="function"/>
<api:function>
<api:returns>
@@ -17,14 +18,17 @@
<api:name>out_len</api:name>
</api:arg>
</api:function>
+
</info>
<title>doc_examples_array_function</title>
+
<synopsis><code mime="text/x-csrc">
gint* doc_examples_array_function (gint* out_len);
</code></synopsis>
-<p>This function returns an array with an explicit length,
-and the length should be invisible in most introspected bindings.</p>
+ <p>This function returns an array with an explicit length,
+and the length should be invisible in most introspected bindings.</p>
+
<table>
<tr>
<td><p>out_len :</p></td>
@@ -35,4 +39,8 @@ and the length should be invisible in most introspected bindings.</p>
<td><p>an array of numbers.</p></td>
</tr>
</table>
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.callback_function.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.callback_function.page
index 89e00a6..2af9330 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.callback_function.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.callback_function.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="index" group="function"/>
<api:function>
<api:returns>
@@ -25,17 +26,20 @@
<api:name>destroy_notify</api:name>
</api:arg>
</api:function>
+
</info>
<title>doc_examples_callback_function</title>
+
<synopsis><code mime="text/x-csrc">
DocExamplesEnum doc_examples_callback_function (DocExamplesCallback callback,
gpointer user_data,
GDestroyNotify destroy_notify);
</code></synopsis>
-<p>This is a function that takes a callback. Different languages
+
+ <p>This is a function that takes a callback. Different languages
will expose this in different ways (e.g. Python keeps the
<code>user_data</code> parameter, while JS doesn't)</p>
-
+
<table>
<tr>
<td><p>callback :</p></td>
@@ -54,4 +58,8 @@ will expose this in different ways (e.g. Python keeps the
<td><p><link xref="DocExamples.Enum">DocExamples.Enum</link>.foo sometimes, <link xref="DocExamples.Enum">DocExamples.Enum</link>.bar other times.</p></td>
</tr>
</table>
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-C-expected/index.page b/tests/doctool/DocExamples-1.0-C-expected/index.page
index c87a104..5143b43 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/index.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/index.page
@@ -3,10 +3,15 @@
type="guide"
style="namespace"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>Index</title>
+
<links type="topic" ui:expanded="yes" groups="class" style="linklist">
<title>Classes</title>
</links>
@@ -16,4 +21,6 @@
<links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Callback.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Callback.page
index b79b93a..c2c171b 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Callback.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Callback.page
@@ -3,9 +3,16 @@
type="topic"
style="default"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.Callback</title>
-
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Enum.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Enum.page
index 0f49606..614b855 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Enum.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Enum.page
@@ -1,13 +1,17 @@
<?xml version="1.0"?>
<page id="DocExamples.Enum"
- type="guide"
+ type="topic"
style="enum"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
- <link type="guide" xref="index"/>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.Enum</title>
+
<p>This is an example to document an enumeration.</p>
<table>
<tr>
@@ -20,4 +24,5 @@
</tr>
</table>
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page
index 43f4b56..3b791bd 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page
@@ -3,14 +3,22 @@
type="topic"
style="property"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="property"/>
<title type="link" role="topic">property-example</title>
+
</info>
<title>DocExamples.Obj:property-example</title>
+
<synopsis><code mime="text/x-python">
"property-example" {unicode: gint8} : Read / Write
</code></synopsis>
-<p>This is an example of how to document a property.</p>
+
+ <p>This is an example of how to document a property.</p>
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page
index 0304b13..8cac161 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page
@@ -3,12 +3,16 @@
type="topic"
style="signal"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="signal"/>
<title type="link" role="topic">signal-example</title>
+
</info>
<title>DocExamples.Obj::signal-example</title>
+
<synopsis><code mime="text/x-python">
def callback(obj, int_param, float_param, pointer_param, user_param1, ...)
</code></synopsis>
@@ -40,5 +44,9 @@ def callback(obj, int_param, float_param, pointer_param, user_param1, ...)
<td><p>additional user parameters (if any)</p></td>
</tr>
</table>
-<p>Since 0.99</p>
+
+ <p>Since 0.99</p>
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page
index 8a02f61..11d693f 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page
@@ -6,16 +6,20 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
- <link type="guide" xref="DocExamples.Obj" group="vfunc"/>
- <title type="link" role="topic">vfunc</title>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.Obj::vfunc</title>
+
<synopsis><code mime="text/x-python">
@accepts(int)
@returns(none)
def do_vfunc(self, first_arg):
</code></synopsis>
-<p>This is an example of how to document a vfunc.</p>
+
+ <p>This is an example of how to document a vfunc.</p>
+
<table>
<tr>
@@ -23,5 +27,9 @@ def do_vfunc(self, first_arg):
<td><p>first argument</p></td>
</tr>
</table>
-<p>Since 0.99</p>
+
+ <p>Since 0.99</p>
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
index 2477e45..89f73d0 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="method"/>
<api:function>
<api:returns>
@@ -37,16 +38,20 @@
<api:name>string</api:name>
</api:arg>
</api:function>
+
</info>
<title>Obj.method</title>
+
<synopsis><code mime="text/x-python">
@accepts(int, float, bool, gpointer, unicode)
@returns(bool)
def method(self, first_arg, second_arg, boolean_arg, pointer_arg, string):
# Python wrapper for doc_examples_obj_method()
</code></synopsis>
-<p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was
+
+ <p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was
created with <link xref="DocExamples.Obj.new">Obj.new</link>.</p><p>This should be a %FALSEALARM.</p>
+
<table>
<tr>
@@ -74,5 +79,9 @@ created with <link xref="DocExamples.Obj.new">Obj.new</link>.</p><p>This should
<td><p>Either <code>False</code> or something <code>False</code>-y.</p></td>
</tr>
</table>
-<p>Since 0.99</p>
+
+ <p>Since 0.99</p>
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page
index 071abf1..6278c64 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page
@@ -1,22 +1,28 @@
<?xml version="1.0"?>
<page id="DocExamples.Obj"
- type="guide"
+ type="topic"
style="class"
xmlns="http://projectmallard.org/1.0/"
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
- <link type="guide" xref="index" group="class"/>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>DocExamples.Obj</title>
-<p>This is an example of how to document a class</p><p>This class has a signal: <link xref="DocExamples.Obj-signal-example">DocExamples.Obj::signal-example</link>.</p><p>And also has a property: <link xref="DocExamples.Obj-property-example">DocExamples.Obj:property-example</link>.</p>
-
+
+
+ <p>This is an example of how to document a class</p><p>This class has a signal: <link xref="DocExamples.Obj-signal-example">DocExamples.Obj::signal-example</link>.</p><p>And also has a property: <link xref="DocExamples.Obj-property-example">DocExamples.Obj:property-example</link>.</p>
+
<synopsis><code>
from gi.repository import DocExamples
obj = DocExamples.Obj(<link xref='DocExamples.Obj-property-example'>property_example</link>=value) </code></synopsis>
-<p>Since 0.99</p>
+
+ <p>Since 0.99</p>
+
<synopsis>
<title>Hierarchy</title>
<tree>
@@ -50,4 +56,6 @@ obj = DocExamples.Obj(<link xref='DocExamples.Obj-property-example'>property_exa
<links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.static_method.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.static_method.page
index e040414..3bc402b 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.static_method.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.static_method.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="DocExamples.Obj" group="function"/>
<api:function>
<api:returns>
@@ -17,16 +18,20 @@
<api:name>out_arg</api:name>
</api:arg>
</api:function>
+
</info>
<title>Obj.static_method</title>
+
<synopsis><code mime="text/x-python">
@accepts(int)
@returns(bool)
def static_method(out_arg):
# Python wrapper for doc_examples_obj_static_method()
</code></synopsis>
-<p>This is an example of a function with an out argument
+
+ <p>This is an example of a function with an out argument
and a return value.</p>
+
<table>
<tr>
@@ -38,4 +43,8 @@ and a return value.</p>
<td><p><code>True</code> if <code>out_arg</code> is valid, <code>False</code> otherwise</p></td>
</tr>
</table>
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.array_function.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.array_function.page
index 3c8e86c..6dd7909 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.array_function.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.array_function.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="index" group="function"/>
<api:function>
<api:returns>
@@ -17,16 +18,20 @@
<api:name>out_len</api:name>
</api:arg>
</api:function>
+
</info>
<title>array_function</title>
+
<synopsis><code mime="text/x-python">
@accepts(int)
@returns([int])
def array_function(out_len):
# Python wrapper for doc_examples_array_function()
</code></synopsis>
-<p>This function returns an array with an explicit length,
+
+ <p>This function returns an array with an explicit length,
and the length should be invisible in most introspected bindings.</p>
+
<table>
<tr>
@@ -38,4 +43,8 @@ and the length should be invisible in most introspected bindings.</p>
<td><p>an array of numbers.</p></td>
</tr>
</table>
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.callback_function.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.callback_function.page
index 58323eb..7c15a0c 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.callback_function.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.callback_function.page
@@ -6,6 +6,7 @@
xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
<link type="guide" xref="index" group="function"/>
<api:function>
<api:returns>
@@ -25,17 +26,21 @@
<api:name>destroy_notify</api:name>
</api:arg>
</api:function>
+
</info>
<title>callback_function</title>
+
<synopsis><code mime="text/x-python">
@accepts(DocExamples.Callback, gpointer, GLib.DestroyNotify)
@returns(DocExamples.Enum)
def callback_function(callback, user_data, destroy_notify):
# Python wrapper for doc_examples_callback_function()
</code></synopsis>
-<p>This is a function that takes a callback. Different languages
+
+ <p>This is a function that takes a callback. Different languages
will expose this in different ways (e.g. Python keeps the
<code>user_data</code> parameter, while JS doesn't)</p>
+
<table>
<tr>
@@ -55,4 +60,8 @@ will expose this in different ways (e.g. Python keeps the
<td><p><link xref="DocExamples.Enum">DocExamples.Enum</link>.foo sometimes, <link xref="DocExamples.Enum">DocExamples.Enum</link>.bar other times.</p></td>
</tr>
</table>
+
+
+
+
</page>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/index.page b/tests/doctool/DocExamples-1.0-Python-expected/index.page
index bbf9d2d..5143b43 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/index.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/index.page
@@ -3,17 +3,24 @@
type="guide"
style="namespace"
xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
xmlns:ui="http://projectmallard.org/experimental/ui/">
<info>
+
+ <link type="guide" xref="index"/>
+
</info>
<title>Index</title>
- <links type="topic" ui:expanded="yes" groups="class">
+
+ <links type="topic" ui:expanded="yes" groups="class" style="linklist">
<title>Classes</title>
</links>
- <links type="topic" ui:expanded="yes" groups="function">
+ <links type="topic" ui:expanded="yes" groups="function" style="linklist">
<title>Functions</title>
</links>
- <links type="topic" ui:expanded="yes" groups="#first #default #last">
+ <links type="topic" ui:expanded="yes" groups="#first #default #last" style="linklist">
<title>Other</title>
</links>
+
+
</page>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]