1. Luke Plant
  2. lukeplant_python

Commits

Luke Plant  committed 7aa85ed

Implemented HTML for scheme index page

  • Participants
  • Parent commits 0682999
  • Branches default

Comments (0)

Files changed (1)

File bibleverses/update.py

View file
 from build import build_schemes
 from StringIO import StringIO
 from config import TOPICSPAGENAME, SCHEMESPAGENAME, SCHEMESPAGENAMEPREFIX, datawriters
+from writers import FileWriter
 
 # All of the 'make_x_page' functions here return a dictionary containing
 # multiple formats of the data to be written.  The 'datawriters' dict
             'html': smart_flatten(html)}
 
 def make_scheme_index_page(schemes, prefix):
+    # WIKI
     wiki = StringIO()
     wiki.write(u"""= Bible Memorisation Schemes =
 
 [[AutoNav()]]
 """)
 
-    return {'wiki': wiki.getvalue()}
+    # HTML
+    html = \
+    [ 
+        T.h1[u"Bible Memorisation Schemes"],
+        T.ul[
+              [T.li[T.a(href=FileWriter.make_html_filename(scheme_page_name(prefix, scheme)))
+                       [ scheme.name ],
+                    T.br,
+                    T.p[ scheme.description ]
+                   ]
+               for scheme in schemes]
+            ]
+    ]                       
+    return {'wiki': wiki.getvalue(),
+            'html': smart_flatten(html)}
 
 if __name__ == '__main__':
     write_pages()