Commits

catseye  committed ee71486

Allow type to specify suppression of page generation for nodes.

  • Participants
  • Parent commits e0ea754

Comments (0)

Files changed (5)

File TODO.markdown

 
 As part of that: put images inline.  (LED-386, Mildred, games...)
 
+Don't necessarily even make nodes for reference distributions.
+
 styling
 -------
 
 
 use two-column layout for (thing, thing distribution)
 
-Don't necessarily even make nodes for reference distributions.
-
 tool
 ----
 

File data/types.yaml

   type: type
 Exhibit:
   type: type
+  suppress-page-generation: true
 Online Installation:
   type: type
+  suppress-page-generation: true
 
 Concept:
   type: type

File src/chrysoberyl/renderer.py

             indefart causes the link text to be preceded by an indefinite
             article.  lower causes the link text to be lowercase.
 
+            If the node is of a type that suppresses page generation, this
+            will raise an exception.  In the future, it may intelligently
+            divert to a different node.
+
             """
+            type = self.data[key]['type']
+            if self.data[type].get('suppress-page-generation', False):
+                raise KeyError('link to non-page (%s) node %s' % (type, key))
             link_text = key
             if lower:
                 link_text = link_text.lower()
         count = 0
         for key in self.data:
             node = self.data[key]
-            if node['type'] in ('Exhibit', 'Online Installation'):
+            if self.data[node['type']].get('suppress-page-generation', False):
                 continue
             self.render_node(key, node)
             count += 1

File templates/Chrysoberyl.html

 <h2>Index of Categories</h2>
 <ul>
 {%- for thing in data.keys()|sort -%}
-  {%- if data[thing].type == 'type'  and thing not in ['type', 'Exhibit', 'Online Installation'] -%}
+  {%- if data[thing].type == 'type' and
+         thing != 'type' and
+         not data[thing].suppress_page_generation -%}
     <li>
       {{ link(thing) }}
     </li>

File templates/type.html

 <ul>
 {% for thing in related('type')|sort -%}
   <li>
-    {{ link(thing) }}
+    {% if not data[key].suppress_page_generation %}
+      {{ link(thing) }}
+    {% else %}
+      {{ thing }}
+    {% endif %}
   </li>
 {% endfor %}
 </ul>