#! /usr/bin/env python2
import sys
import datetime
import types
from collections import OrderedDict
tabs = OrderedDict([
("Overview", OrderedDict([
("index",""),
])),
("Documentation", OrderedDict([
("news", "News"),
("migration", "Migration"),
("tutorial", "Tutorial"),
("herbstluftwm", "herbstluftwm(1)"),
("herbstclient", "herbstclient(1)"),
])),
("FAQ", OrderedDict([
("faq", "FAQ"),
])),
("Download", OrderedDict([
("download", "Download"),
])),
("Wiki", "http://wiki.herbstluftwm.org"),
])
page2tab = {}
filename = sys.argv[1]
name = filename.replace('-content.html', '')
toc = filename.replace('-content.html', '-toc.html')
windowtitle = "herbstluftwm"
for title, subpages in tabs.iteritems():
if not isinstance(subpages, basestring):
for fn, subtitle in subpages.iteritems():
page2tab[fn] = title
if not ("" == subtitle) and (name == fn):
windowtitle = subtitle + " - herbstluftwm"
curtab = page2tab[name]
#====~===~=========~==
# Header
#====~===~=========~==
print """\
{title}
herbstluftwm
a manual tiling window manager for X
""".format(title=windowtitle)
#====~===~=========~==
# Navigation bar
#====~===~=========~==
print """\
"""
for title, subpages in tabs.iteritems():
classstring = "notab"
if title == curtab:
classstring = "curtab"
if isinstance(subpages, basestring):
trg = subpages
else:
trg = subpages.keys()[0] + ".html"
print '