summaryrefslogtreecommitdiff
path: root/giscanner/doctemplates
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2015-12-13 21:58:27 -0800
committerrockon999 <rockon999@users.noreply.github.com>2018-08-06 02:53:45 -0500
commitcd7b575d7a2c0cb1e31221be03dc447280d7999c (patch)
tree9d1ea984ad3730b4c962fa4d6c99fc4ad24b03b5 /giscanner/doctemplates
parent916c626a4e17f356eaa5b73b9e67aaaab310e212 (diff)
downloadgobject-introspection-cd7b575d7a2c0cb1e31221be03dc447280d7999c.tar.gz
devdocs: Add extra CSS class to default.tmpl
We add an extra CSS class to default.tmpl to indicate what kind of AST node is represented here (e.g., ast.Constant). This should properly belong in get_node_kind() in docwriter.py, but adding extra kinds there would affect the way that all the other documentation output formats are generated.
Diffstat (limited to 'giscanner/doctemplates')
-rw-r--r--giscanner/doctemplates/devdocs/Gjs/base.tmpl4
-rw-r--r--giscanner/doctemplates/devdocs/Gjs/default.tmpl8
2 files changed, 11 insertions, 1 deletions
diff --git a/giscanner/doctemplates/devdocs/Gjs/base.tmpl b/giscanner/doctemplates/devdocs/Gjs/base.tmpl
index 3ca46a3e..913fa0cc 100644
--- a/giscanner/doctemplates/devdocs/Gjs/base.tmpl
+++ b/giscanner/doctemplates/devdocs/Gjs/base.tmpl
@@ -2,7 +2,7 @@
<html>
<body>
<section>
- <h1 class="${page_kind} ${doc.deprecated_class(node)}">
+ <h1 class="${page_kind} ${doc.deprecated_class(node)} ${self.extra_class()}">
${formatter.format_page_name(node)}
</h1>
<%include file="_index.tmpl"/>
@@ -17,3 +17,5 @@
</section>
</body>
</html>
+
+<%def name="extra_class()"/>
diff --git a/giscanner/doctemplates/devdocs/Gjs/default.tmpl b/giscanner/doctemplates/devdocs/Gjs/default.tmpl
index 0c0fdf6c..2341ef4d 100644
--- a/giscanner/doctemplates/devdocs/Gjs/default.tmpl
+++ b/giscanner/doctemplates/devdocs/Gjs/default.tmpl
@@ -8,3 +8,11 @@
</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
+ % endif
+</%def>