summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates/class.tmpl
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2014-02-19 16:19:53 +0100
committerGiovanni Campagna <gcampagna@src.gnome.org>2014-02-20 02:07:48 +0100
commit75d25b7f47542aa003c92ce576b6e82bae66aec9 (patch)
treefe44b2083492e76f8bda7d903db169530dcba2b4 /giscanner/doctemplates/class.tmpl
parentbd4608b6c761209bca8362bd5524e4dbe781e532 (diff)
downloadgobject-introspection-75d25b7f47542aa003c92ce576b6e82bae66aec9.tar.gz
doctool: improve Gjs documentation
- Add documentation for structures, fields, constants and callbacks - Improve the synopsis for interfaces to have prerequisites and known implementations - Respect gjs constraints for field writability - Format in and out parameters for callables according to GJS conventions - Format property names according to the GJS API - Show boxed constructors according to how they can be used in the gjs API https://bugzilla.gnome.org/show_bug.cgi?id=724735
Diffstat (limited to 'giscanner/doctemplates/class.tmpl')
-rw-r--r--giscanner/doctemplates/class.tmpl27
1 files changed, 24 insertions, 3 deletions
diff --git a/giscanner/doctemplates/class.tmpl b/giscanner/doctemplates/class.tmpl
index 7f8b6869..86333866 100644
--- a/giscanner/doctemplates/class.tmpl
+++ b/giscanner/doctemplates/class.tmpl
@@ -1,6 +1,7 @@
<%! page_type="guide" %>\
<%inherit file="/base.tmpl"/>
<%block name="details">
+% if isinstance(node, ast.Class):
<synopsis>
<title>Hierarchy</title>
<tree>
@@ -13,8 +14,23 @@
% endfor
</tree>
</synopsis>
+% elif isinstance(node, ast.Interface):
+ <synopsis>
+ <title>Prerequisites</title>
+ <p>${node.name} requires ${formatter.format_prerequisites(node)}</p>
+ </synopsis>
+ <synopsis>
+ <title>Known Implementations</title>
+ <p>${formatter.format_known_implementations(node)}</p>
+ </synopsis>
+% endif
</%block>
-<%block name="links">
+<%block name="links">\
+ <links type="topic" ui:expanded="true"
+ api:type="function" api:mime="${formatter.mime_type}"
+ groups="constructor" style="linklist">
+ <title>Constructors</title>
+ </links>
<links type="topic" ui:expanded="true"
api:type="function" api:mime="${formatter.mime_type}"
groups="method" style="linklist">
@@ -23,8 +39,9 @@
<links type="topic" ui:expanded="true"
api:type="function" api:mime="${formatter.mime_type}"
groups="function" style="linklist">
- <title>Functions</title>
+ <title>Static Functions</title>
</links>
+% if isinstance(node, (ast.Class, ast.Interface)):
<links type="topic" ui:expanded="true" groups="property" style="linklist">
<title>Properties</title>
</links>
@@ -34,7 +51,11 @@
<links type="topic" ui:expanded="true" groups="vfunc" style="linklist">
<title>Virtual functions</title>
</links>
+% endif
+ <links type="topic" ui:expanded="true" groups="field" style="linklist">
+ <title>Fields</title>
+ </links>
<links type="topic" ui:expanded="true" groups="#first #default #last" style="linklist">
<title>Other</title>
- </links>
+ </links>\
</%block>