<dl>
"""]
-for count, tag, links in all_tags:
+for i, (count, tag, links) in enumerate(all_tags):
new_text.append("""\
<dt><a href="%s.html">%s (%d)</a></dt>
""" % (tag, tag, count))
+ first = all_tags[0][1]
+ if i == 0:
+ prev = None
+ else:
+ prev = all_tags[i-1][1]
+ if i >= len(all_tags)-1:
+ next = None
+ else:
+ next = all_tags[i+1][1]
+ last = all_tags[-1][1]
+
tag_text = ["""\
## THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
#extends phd_pp_ru
#implements respond
#attr $Title = "Oleg Broytman's blog: tag %s"
#attr $Description = "Broytman Russian Blog Tag %s Index Document"
+""" % (tag, tag)]
+
+ tag_text.append("""\
+#attr $First = "%s"
+""" % first)
+
+ if prev:
+ tag_text.append("""\
+#attr $Prev = "%s"
+""" % prev)
+
+ if next:
+ tag_text.append("""\
+#attr $Next = "%s"
+""" % next)
+
+ tag_text.append("""\
+#attr $Last = "%s"
+""" % last)
+
+ tag_text.append("""\
#attr $Copyright = 2006
##
#def body_html
<p class="head">
<ul>
-""" % (tag, tag, tag)]
+""" % tag)
count = 0
for year, month, day, filename, title, lead in reversed(links):