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 | |
| 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
| -rw-r--r-- | _template_.html | 7 | ||||
| -rw-r--r-- | config.py | 2 | ||||
| -rwxr-xr-x | writeHTML.py | 29 |
3 files changed, 30 insertions, 8 deletions
diff --git a/_template_.html b/_template_.html index a3b1130..83abb85 100644 --- a/_template_.html +++ b/_template_.html @@ -15,14 +15,15 @@ <!-- anon bib anonymity bibliography --> <title>%(title)s</title> -<link rel="stylesheet" type="text/css" href="./css/main.css" /> -<link rel="stylesheet" type="text/css" href="./css/pubs.css" /> +<link rel="stylesheet" type="text/css" href="%(root)s/css/main.css" /> +<link rel="stylesheet" type="text/css" href="%(root)s/css/pubs.css" /> </head> <body bgcolor="#ffffff" text="#000000" link="#bb0000" vlink="#990099" alink="#ff9900" > -<h1 align="center">Anonymity bibliography</h1> +<h1 align="center">%(short_title)s</h1> +<p align="center">%(otherbibs)s</p> <p align="center">%(choices)s</p> <!-- Table 1: contains the sidebar and the body. --> @@ -8,7 +8,7 @@ _KEYS = [ "ALL_TAGS", "DOWNLOAD_CONNECT_TIMEOUT","INITIAL_STRINGS", "MASTER_BIB", "NO_COLLAPSE_AUTHORS", "OMIT_ENTRIES", "OUTPUT_DIR", "TEMPLATE_FILE", "BIBTEX_TEMPLATE_FILE", - "REQUIRE_KEY", "TAG_TITLES", "TAG_DIRECTORIES" ] + "REQUIRE_KEY", "TAG_TITLES", "TAG_DIRECTORIES", "TAG_SHORT_TITLES" ] for _k in _KEYS: globals()[_k]=None 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() |
