diff options
Diffstat (limited to 'giscanner/doctemplates/Python')
9 files changed, 43 insertions, 121 deletions
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 @@ -<?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 1d202109..991f29be 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 c1a4d8c5..09f4d9a8 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 1976a1ca..683ca835 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 97bd7132..372cd33f 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 7f4138cd..db78f2b9 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 43bea043..cfe71c15 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 8dda89be..a430d9b9 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 86dc685b..65af0058 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> |