summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2015-12-13 21:59:49 -0800
committerrockon999 <rockon999@users.noreply.github.com>2018-08-06 02:53:45 -0500
commit88957d28a02117f8768ebd6d71fc2cc5e5cc7e06 (patch)
treeae98202fd0a4dff160a184e96412166296b325fd
parentcd7b575d7a2c0cb1e31221be03dc447280d7999c (diff)
downloadgobject-introspection-88957d28a02117f8768ebd6d71fc2cc5e5cc7e06.tar.gz
devdocs: Describe aliases more thoroughly
For aliases we add a description of what Javascript type they map to.
-rw-r--r--giscanner/doctemplates/devdocs/Gjs/default.tmpl16
1 files changed, 16 insertions, 0 deletions
diff --git a/giscanner/doctemplates/devdocs/Gjs/default.tmpl b/giscanner/doctemplates/devdocs/Gjs/default.tmpl
index 2341ef4d..4b08adff 100644
--- a/giscanner/doctemplates/devdocs/Gjs/default.tmpl
+++ b/giscanner/doctemplates/devdocs/Gjs/default.tmpl
@@ -8,11 +8,27 @@
</dd>
</dl>
% endif
+% if isinstance(node, ast.Alias):
+ <dl>
+ <dt>Equivalent Type</dt>
+ <dd>
+ <code data-mime="application/javascript">
+ % if node.target.target_fundamental:
+ ${formatter.format_fundamental_type(node.target.target_fundamental)}
+ % else:
+ ${node.target.target_giname}
+ % endif
+ </code>
+ </dd>
+ </dl>
+% endif
## This should belong in get_node_kind(), but we don't want to change the way
## all the other templates work.
<%def name="extra_class()">
% if isinstance(node, ast.Constant):
constant
+ % elif isinstance(node, ast.Alias):
+ alias
% endif
</%def>