diff options
| author | Nick Mathewson <nickm@torproject.org> | 2007-06-27 18:26:42 +0000 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2007-06-27 18:26:42 +0000 |
| commit | 1673d2b2948143cd8f0eb85a2dfec192015052be (patch) | |
| tree | 0828da3c9492e84d9cc405a2688c06acb21a8f7b /writeHTML.py | |
| parent | 4bb131fdace995de47b2d2f0de95cd2d8d5895f4 (diff) | |
| download | anonbib-1673d2b2948143cd8f0eb85a2dfec192015052be.tar.gz | |
r13508@kushana: nickm | 2007-06-27 14:26:35 -0400
More anonbib hacking to generate sane page headings, use CSS right on subpages, and link from the different bibliographies to one another.
svn:r217
Diffstat (limited to 'writeHTML.py')
| -rwxr-xr-x | writeHTML.py | 29 |
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 = " | ".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() |
