Commits

Anonymous committed 3499b3d

add main nav to top of index

Comments (0)

Files changed (1)

                 <meta name="author" content="Code Fox">
                 <meta charset="UTF-8">
 
-                <link rel="stylesheet" type="text/css" href="pdb/main.css">
+                <link rel="stylesheet" type="text/css" href="main.css">
 
                 </style>
         </head>
         <body>
-                <div style="display:inline-block;">
-                        <h1>Gimp Plugin Database</h1>
-                        <div id="author">
-                                <span class="date">
-                                        ${date}
-                                </span>
+                <a id="top"></a>
+                <div style="text-align:center">
+                        <div style="display:inline-block; margin:0px auto 0px auto;">
+                                <h1>Gimp Plugin Database</h1>
+                                <div id="author">
+                                        <span class="date">
+                                                ${date}
+                                        </span>
+                                </div>
                         </div>
                 </div>
-                <a href="#top"></top>
                 ${body}
         </body>
 </html>
         if not os.path.exists(outDirectory):
                 os.makedirs(outDirectory)
 
-        with open(os.path.join(outDirectory, "main.css"),'w') as f:
+        with open(os.path.join(root, "main.css"),'w') as f:
                 f.write(PROC_CSS)
 
         return None
 
         return PROC_TYPES[t]
 
-def make_table(lst) :
+def table(lst) :
         row = dict()
         html = ""
         alt = False
 def file_name(name) :
         return "%s.html"%(slugify(name))
 
-def plain_table(lst, heading=None, length=5):
-        if (None == heading) :
-                heading = "sentinel"
-
+def plain_table(heading, lst, max_row_length=5):
         buf = ""
         buf += Template('\t\t<a id="${heading}"><h4>${heading}</h4></a>\n').safe_substitute({"heading":heading})
         buf += '\t\t<table>\n\t\t\t<tr>\n'
         for item in lst:
                 count += 1
                 # special
-                buf += Template('\t\t\t\t<td><a href="pdb/${file}.html">${item}</a></td>\n').safe_substitute({"file":file_name(item), "item":item[len(heading):]})
+                buf += Template('\t\t\t\t<td><a href="pdb/${file}.html" title="${item}">${item}</a></td>\n').safe_substitute({"file":file_name(item), "item":item})
                 # special
-                if 0 == (count % length):
+                if 0 == (count % max_row_length):
                         buf += '\t\t\t</tr>\n\t\t\t<tr>\n'
 
         buf += '\t\t\t</tr>\n\t\t</table>\n\t\t<nav><a href="#top">top</a></nav>\n'
                                 break
 
                 if(node == unvisited[-1]):
-                        # post fix, no new unvisited children found
+                        # post fix; no new unvisited children found
                         if(size(node) > minSize):
                                 ns_list.append(namespace)
                         elif (node == root):
 
 def index(procs) :
 
-        buf = ""
+        lst = headings(procs)
 
-        for heading in headings(procs) :
+        buf = '\t\t<hr>\n\t\t<nav class="main">'
+        for heading in lst :
+                buf += Template('<a href="#${heading}-" style="font-size:1.05em;">${heading}</a>').safe_substitute({"heading":heading[:-1]})
 
-                buf += plain_table(filter(lambda name: name.startswith(heading),procs), heading)
+                if(heading != lst[-1]):
+                        buf += " &bull; "
+
+        buf += "</nav>\n\t\t<hr>\n"
+
+        for heading in lst :
+                buf += plain_table(heading, filter(lambda name: name.startswith(heading),procs))
                 procs = filter(lambda name: not name.startswith(heading),procs)
 
-        buf += plain_table(procs)
-
         return buf
 
 def dump_pdb() :