diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2012-02-20 17:35:08 +0100 |
---|---|---|
committer | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2012-02-20 17:35:08 +0100 |
commit | 67d354dc97c107c490a555a5e9ff245dc0cae2cc (patch) | |
tree | 963df0c0c11622a5311366b60d04c9ac9ab93d05 /giscanner | |
parent | 5cb2864c612e06c430e81037a9ff58b30409bebe (diff) | |
download | gobject-introspection-67d354dc97c107c490a555a5e9ff245dc0cae2cc.tar.gz |
g-ir-doc-tool: Add some more stuff to Enum pages
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/mallard-Python-enum.tmpl | 23 | ||||
-rw-r--r-- | giscanner/mallardwriter.py | 3 |
2 files changed, 26 insertions, 0 deletions
diff --git a/giscanner/mallard-Python-enum.tmpl b/giscanner/mallard-Python-enum.tmpl new file mode 100644 index 00000000..fd6ca0fb --- /dev/null +++ b/giscanner/mallard-Python-enum.tmpl @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<page id="${node.namespace.name}.${node.name}" + type="guide" + style="enum" + xmlns="http://projectmallard.org/1.0/" + xmlns:ui="http://projectmallard.org/experimental/ui/"> + <info> + <link type="guide" xref="index"/> + </info> + <title>${node.namespace.name}.${node.name}</title> + ${formatter.format(node.doc)} +% if node.members: +<table> +% for member, ix in zip(node.members, range(len(node.members))): +<tr> +<td><p>${node.name}.${member.name.upper()} :</p></td> +<td>${formatter.format(member.doc)}</td> +</tr> +% endfor +</table> +% endif + +</page> diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py index 87b6f55c..5fd97048 100644 --- a/giscanner/mallardwriter.py +++ b/giscanner/mallardwriter.py @@ -210,6 +210,9 @@ class MallardWriter(object): page_id = '%s.%s.%s' % (namespace.name, node.parent.name, node.name) else: page_id = '%s.%s' % (namespace.name, node.name) + elif isinstance(node, ast.Enum): + template_name = 'mallard-%s-enum.tmpl' % self._language + page_id = '%s.%s' % (namespace.name, node.name) elif isinstance(node, ast.Property) and node.parent is not None: template_name = 'mallard-%s-property.tmpl' % self._language page_id = '%s.%s-%s' % (namespace.name, node.parent.name, node.name) |