Fix errors in phantom and stub page building

This commit is contained in:
Jaculabilis 2017-08-27 00:27:52 -05:00
parent 3288db27a1
commit fd67ad9ed8
1 changed files with 5 additions and 6 deletions

View File

@ -279,13 +279,12 @@ def build_phantom_page(title, cite_map, config):
"<div class=\"content citeblock\">\n"\ "<div class=\"content citeblock\">\n"\
"<p>Cited by: {citedby}</p>\n"\ "<p>Cited by: {citedby}</p>\n"\
"</div>\n".format( "</div>\n".format(
cites=cites_str,
citedby=citedby_str) citedby=citedby_str)
# Fill in the entry skeleton # Fill in the entry skeleton
entry_skeleton = load_resource("entry-page.html") entry_skeleton = load_resource("entry-page.html")
css = load_resource("lexicon.css") css = load_resource("lexicon.css")
return entry_skeleton.format( return entry_skeleton.format(
title=lex["title"], title=title,
lexicon=config["LEXICON_TITLE"], lexicon=config["LEXICON_TITLE"],
css=css, css=css,
logo=config["LOGO_FILENAME"], logo=config["LOGO_FILENAME"],
@ -306,20 +305,21 @@ def build_stub_page(title, cite_map, config):
content = "<p>[The handwriting is completely illegible.]</p>\n"\ content = "<p>[The handwriting is completely illegible.]</p>\n"\
"<hr><span class=\"signature\"><p>Ersatz Scrivener</p></span>\n" "<hr><span class=\"signature\"><p>Ersatz Scrivener</p></span>\n"
# Build the stub citeblock # Build the stub citeblock
cites, citedby = citation_lists(title, cite_map) citedby = [citer_title
for citer_title, cited_titles in cite_map.items()
if title in cited_titles]
citedby_str = " | ".join([lf(None, title, title) for title in citedby]) citedby_str = " | ".join([lf(None, title, title) for title in citedby])
citeblock = ""\ citeblock = ""\
"<div class=\"content citeblock\">\n"\ "<div class=\"content citeblock\">\n"\
"<p>Citations: [Illegible]</p>\n"\ "<p>Citations: [Illegible]</p>\n"\
"<p>Cited by: {citedby}</p>\n"\ "<p>Cited by: {citedby}</p>\n"\
"</div>\n".format( "</div>\n".format(
cites=cites_str,
citedby=citedby_str) citedby=citedby_str)
# Fill in the entry skeleton # Fill in the entry skeleton
entry_skeleton = load_resource("entry-page.html") entry_skeleton = load_resource("entry-page.html")
css = load_resource("lexicon.css") css = load_resource("lexicon.css")
return entry_skeleton.format( return entry_skeleton.format(
title=lex["title"], title=title,
lexicon=config["LEXICON_TITLE"], lexicon=config["LEXICON_TITLE"],
css=css, css=css,
logo=config["LOGO_FILENAME"], logo=config["LOGO_FILENAME"],
@ -510,7 +510,6 @@ def command_build(argv):
print "Clearing old HTML files" print "Clearing old HTML files"
for filename in os.listdir("out/"): for filename in os.listdir("out/"):
if filename[-5:] == ".html": if filename[-5:] == ".html":
print filename
os.remove("out/" + filename) os.remove("out/" + filename)
# Write the written entries # Write the written entries
print "Writing written articles..." print "Writing written articles..."