From 9c68ba7c6f8b6b7367ccad1877d28cd526045961 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 31 Jan 2013 11:46:13 -0500 Subject: doctool: Use a base template for all pages --- .../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 +++++----------------- 9 files changed, 43 insertions(+), 121 deletions(-) (limited to 'giscanner/doctemplates/Python') diff --git a/giscanner/doctemplates/Python/mallard-Python-class.tmpl b/giscanner/doctemplates/Python/mallard-Python-class.tmpl index 800d241f..3f0d67a1 100644 --- a/giscanner/doctemplates/Python/mallard-Python-class.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-class.tmpl @@ -1,16 +1,6 @@ - - - - - - ${formatter.format_page_name(node)} -${formatter.format(node, node.doc)} - +<%inherit file="mallard-base.tmpl"/> +<%block name="content"> + ${parent.content()} from gi.repository import ${namespace.name} @@ -26,9 +16,7 @@ ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}( )\ -% if node.version: -

Since ${node.version}

-% endif + ${self.since_version()} Hierarchy @@ -63,4 +51,4 @@ ${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}( Other -
+ diff --git a/giscanner/doctemplates/Python/mallard-Python-default.tmpl b/giscanner/doctemplates/Python/mallard-Python-default.tmpl index 1d202109..991f29be 100644 --- a/giscanner/doctemplates/Python/mallard-Python-default.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-default.tmpl @@ -1,11 +1 @@ - - - - - ${formatter.format_page_name(node)} -${formatter.format(node, node.doc)} - +<%inherit file="mallard-base.tmpl"/> diff --git a/giscanner/doctemplates/Python/mallard-Python-enum.tmpl b/giscanner/doctemplates/Python/mallard-Python-enum.tmpl index c1a4d8c5..09f4d9a8 100644 --- a/giscanner/doctemplates/Python/mallard-Python-enum.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-enum.tmpl @@ -1,13 +1,5 @@ - - - - - - ${formatter.format_page_name(node)} +<%inherit file="mallard-base.tmpl"/> +<%block name="content"> ${formatter.format(node, node.doc)} % if node.members: @@ -19,5 +11,4 @@ % endfor
% endif - -
+ diff --git a/giscanner/doctemplates/Python/mallard-Python-function.tmpl b/giscanner/doctemplates/Python/mallard-Python-function.tmpl index 1976a1ca..683ca835 100644 --- a/giscanner/doctemplates/Python/mallard-Python-function.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-function.tmpl @@ -1,11 +1,5 @@ - - - +<%inherit file="mallard-base.tmpl"/> +<%block name="info"> % if node.parent is not None: % else: @@ -33,8 +27,8 @@ % endif % endfor - - ${formatter.format_page_name(node)} + +<%block name="content"> % if len(node.parameters) != 0: @accepts(\ @@ -51,7 +45,7 @@ ${', '.join((arg.argname for arg in node.parameters))}\ ): # Python wrapper for ${node.symbol}() -${formatter.format(node, node.doc)} +${parent.content()} % if node.parameters or node.retval: @@ -69,7 +63,5 @@ ${formatter.format(node, node.doc)} % endif
% endif -% if node.version: -

Since ${node.version}

-% endif -
+${self.since_version()} + diff --git a/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl b/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl index 97bd7132..372cd33f 100644 --- a/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-namespace.tmpl @@ -1,19 +1,13 @@ - - - - - ${formatter.format_page_name(node)} - +<%! page_type="guide" %>\ +<%inherit file="mallard-base.tmpl"/> +<%block name="content"> + Classes - + Functions - + Other - + diff --git a/giscanner/doctemplates/Python/mallard-Python-property.tmpl b/giscanner/doctemplates/Python/mallard-Python-property.tmpl index 7f4138cd..db78f2b9 100644 --- a/giscanner/doctemplates/Python/mallard-Python-property.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-property.tmpl @@ -1,16 +1,11 @@ - - - +<%inherit file="mallard-base.tmpl"/> +<%block name="info"> ${node.name} - - ${formatter.format_page_name(node)} + +<%block name="content"> "${node.name}" ${formatter.format_type(node.type)} : ${formatter.format_property_flags(node)} -${formatter.format(node, node.doc)} - +${parent.content()} + diff --git a/giscanner/doctemplates/Python/mallard-Python-record.tmpl b/giscanner/doctemplates/Python/mallard-Python-record.tmpl index 43bea043..cfe71c15 100644 --- a/giscanner/doctemplates/Python/mallard-Python-record.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-record.tmpl @@ -1,12 +1,2 @@ - - - - - - ${formatter.format_page_name(node)} -

${node.doc}

-
+<%! 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 8dda89be..a430d9b9 100644 --- a/giscanner/doctemplates/Python/mallard-Python-signal.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-signal.tmpl @@ -1,14 +1,9 @@ - - - +<%inherit file="mallard-base.tmpl"/> +<%block name="info"> ${node.name} - - ${formatter.format_page_name(node)} + +<%block name="content"> 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)} % endif -% if node.version: -

Since ${node.version}

-% endif -
+${self.since_version()} + + diff --git a/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl b/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl index 86dc685b..65af0058 100644 --- a/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl +++ b/giscanner/doctemplates/Python/mallard-Python-vfunc.tmpl @@ -1,15 +1,5 @@ - - - - - ${node.name} - - ${formatter.format_page_name(node)} +<%inherit file="mallard-base.tmpl"/> +<%block name="content"> % if len(node.parameters) != 0: @accepts(\ @@ -22,7 +12,7 @@ do_${node.name}(self, \ ${', '.join((arg.argname for arg in node.parameters))}\ ): -${formatter.format(node, node.doc)} +${parent.content()} % if node.parameters or node.retval: @@ -40,7 +30,5 @@ ${formatter.format(node, node.doc)} % endif
% endif -% if node.version: -

Since ${node.version}

-% endif -
+${self.since_version()} + -- cgit v1.2.1