aboutsummaryrefslogtreecommitdiffstats
path: root/writeHTML.py
diff options
context:
space:
mode:
Diffstat (limited to 'writeHTML.py')
-rwxr-xr-xwriteHTML.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/writeHTML.py b/writeHTML.py
index e6992d9..3184ef0 100755
--- a/writeHTML.py
+++ b/writeHTML.py
@@ -49,11 +49,14 @@ def writeBody(f, sections, section_urls, cache_path):
print >>f, "</ul></li>"
def writeHTML(f, sections, sectionType, fieldName, choices,
- title, cache_url_path, section_urls={}):
+ tag, config, cache_url_path, section_urls={}):
"""sections: list of (sectionname, [list of BibTeXEntry])'''
sectionType: str
fieldName: str
choices: list of (choice, url)"""
+
+ title = config.TAG_TITLES[tag]
+ short_title = config.TAG_SHORT_TITLES[tag]
#
secStr = []
for s, _ in sections:
@@ -64,6 +67,21 @@ def writeHTML(f, sections, sectionType, fieldName, choices,
secStr = "".join(secStr)
#
+ tagListStr = []
+ st = config.TAG_SHORT_TITLES.keys()
+ st.sort()
+ root = "../"*pathLength(config.TAG_DIRECTORIES[tag])
+ if root == "": root = "."
+ for t in st:
+ name = config.TAG_SHORT_TITLES[t]
+ if t == tag:
+ tagListStr.append(name)
+ else:
+ url = BibTeX.smartJoin(root, config.TAG_DIRECTORIES[t], "date.html")
+ tagListStr.append("<a href='%s'>%s</a>"%(url, name))
+ tagListStr = "&nbsp;|&nbsp;".join(tagListStr)
+
+ #
choiceStr = []
for choice, url in choices:
if url:
@@ -78,7 +96,10 @@ def writeHTML(f, sections, sectionType, fieldName, choices,
'choices' : choiceStr,
'field': fieldName,
'sections' : secStr,
+ 'otherbibs' : tagListStr,
'title': title,
+ 'short_title': short_title,
+ "root" : root,
}
header, footer = getTemplate(config.TEMPLATE_FILE)
@@ -122,7 +143,7 @@ def writePageSet(config, bib, tag):
("By date", "./date.html"),
("By author", "./author.html")
),
- title=config.TAG_TITLES[tag],
+ tag=tag, config=config,
cache_url_path=cache_url_path)
f.close()
@@ -153,7 +174,7 @@ def writePageSet(config, bib, tag):
("By date", None),
("By author", "./author.html")
),
- title=config.TAG_TITLES[tag],
+ tag=tag, config=config,
cache_url_path=cache_url_path)
f.close()
@@ -166,7 +187,7 @@ def writePageSet(config, bib, tag):
("By date", "./date.html"),
("By author", None),
),
- title=config.TAG_TITLES[tag],
+ tag=tag, config=config,
cache_url_path=cache_url_path,
section_urls=url_map)
f.close()