[gobject-introspection: 16/30] devdocs: Add extra CSS class to default.tmpl



commit cd7b575d7a2c0cb1e31221be03dc447280d7999c
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Dec 13 21:58:27 2015 -0800

    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.

 giscanner/doctemplates/devdocs/Gjs/base.tmpl    | 4 +++-
 giscanner/doctemplates/devdocs/Gjs/default.tmpl | 8 ++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
---
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>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]