summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates/devdocs/Gjs/namespace.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/doctemplates/devdocs/Gjs/namespace.tmpl')
-rw-r--r--giscanner/doctemplates/devdocs/Gjs/namespace.tmpl57
1 files changed, 57 insertions, 0 deletions
diff --git a/giscanner/doctemplates/devdocs/Gjs/namespace.tmpl b/giscanner/doctemplates/devdocs/Gjs/namespace.tmpl
new file mode 100644
index 00000000..8f5a4e7e
--- /dev/null
+++ b/giscanner/doctemplates/devdocs/Gjs/namespace.tmpl
@@ -0,0 +1,57 @@
+<%def name="get_types(n, types)">
+ <% nodes = [] %>
+ % for a in n.values():
+ % if isinstance(a, types):
+ % if formatter.should_render_node(a):
+ <% nodes.append(a) %>
+ % endif
+ % endif
+ % endfor
+ <% return nodes %>
+</%def>
+
+<%def name="render_list(nodes)">
+ <ul>
+ % for a in nodes:
+ <li>${formatter.format_inline(a, formatter.format_xref(a))}</li>
+ % endfor
+ </ul>
+</%def>
+
+<html>
+<body>
+ <section>
+ <h1 class="namespace">${node.name}</h1>
+ </section>
+
+ <% nodes = get_types(node, (ast.Class, ast.Interface)) %>
+ % if len(nodes) > 0:
+ <h1>Classes</h1>
+ ${render_list(nodes)}
+ % endif
+
+ <% nodes = get_types(node, (ast.Enum)) %>
+ % if len(nodes) > 0:
+ <h1>Enums</h1>
+ ${render_list(nodes)}
+ % endif
+
+ <% nodes = get_types(node, (ast.Function)) %>
+ % if len(nodes) > 0:
+ <h1>Functions</h1>
+ ${render_list(nodes)}
+ % endif
+
+ <% nodes = get_types(node, (ast.Constant)) %>
+ % if len(nodes) > 0:
+ <h1>Constants</h1>
+ ${render_list(nodes)}
+ % endif
+
+ <% nodes = get_types(node, (ast.Property)) %>
+ % if len(nodes) > 0:
+ <h1>Properties</h1>
+ ${render_list(nodes)}
+ % endif
+</body>
+</html>