diff --git a/makeheader.py b/makeheader.py index 87b5693..65bddad 100644 --- a/makeheader.py +++ b/makeheader.py @@ -92,14 +92,14 @@ def linkgen(ficno,output="output.html",local=False): # write ao3 link if there is one try: if fileread.ao3slug: - filewrite.write("
  • AO3
  • \n") + filewrite.write(" locked") + filewrite.write("\" href=\"https://archiveofourown.org/works/" + str(fileread.ao3slug) + "\">AO3\n") except: pass # write fedi share link if there is one @@ -246,11 +246,11 @@ def linkgen(ficno,output="output.html",local=False): filewrite.write("\">comments\n") except: pass - filewrite.write("\n") + filewrite.write("\n") except: pass -def ficgen(ficno,unique=False,output="output.html",local=False): +def ficgen(ficno,unique=False,output="output.html",local=False,single=False): # convert to three-digit number if ficno < 10: ficnostring = "00" + str(ficno) @@ -284,11 +284,14 @@ def ficgen(ficno,unique=False,output="output.html",local=False): if revealed == True: # write to output file filewrite = open(output, "a") - filewrite.write("
    \n

    no. \n

    no. ") # write title if requested if fileread.showtitle: - filewrite.write(" " + fileread.title) + filewrite.write(" " + fileread.title) try: if transread.showtitle: filewrite.write("/" + transread.title) @@ -322,26 +325,26 @@ def ficgen(ficno,unique=False,output="output.html",local=False): pass if fileread.status == "abandoned": filewrite.write(" (abandoned)") - filewrite.write("

    \n
      \n
    • Date: ") + filewrite.write("

    \n
    \n
      \n
    • Date: ") # write date, date range if ranged or translation if fileread.status == "incomplete": - filewrite.write((fileread.datewords[0])["date"].strftime("%-d %B %Y") + "–") + filewrite.write("–") else: try: if transread.status == "incomplete": - filewrite.write((fileread.datewords[0])["date"].strftime("%-d %B %Y") + "–") + filewrite.write("–") else: if fileread.translation: if (transread.datewords[-1])["date"].year == (fileread.datewords[0])["date"].year: if (transread.datewords[-1])["date"].month == (fileread.datewords[0])["date"].month: if (transread.datewords[-1])["date"].date == (fileread.datewords[0])["date"].date: - filewrite.write((fileread.datewords[0])["date"].strftime("%-d %B %Y")) + filewrite.write("") else: - filewrite.write((fileread.datewords[0])["date"].strftime("%-d") + "–" + (transread.datewords[-1])["date"].strftime("%-d %B %Y")) + filewrite.write("") else: - filewrite.write((fileread.datewords[0])["date"].strftime("%-d %B") + "–" + (transread.datewords[-1])["date"].strftime("%-d %B %Y")) + filewrite.write("
    • \n
    • Fandom: ") + filewrite.write("
    • \n
    • Fandom: ") # write fandom try: filewrite.write(fileread.fandomtext) except: filewrite.write("/".join(fileread.fandom)) - filewrite.write("
    • \n") + filewrite.write("\n") # write characters in pov, main, secondary categories, if they exist try: filewrite.write("
    • Characters: " + fileread.charactertext + "
    • \n") @@ -602,4 +605,7 @@ def ficgen(ficno,unique=False,output="output.html",local=False): linkgen(ficno,output,local) filewrite = open(output, "a") filewrite.write("
    \n") + if single: + filewrite.write("
    \n") + filewrite.write("
    \n") filewrite.close() diff --git a/single.py b/single.py index fc952c8..1ad3ef9 100644 --- a/single.py +++ b/single.py @@ -37,11 +37,11 @@ def singlepage(ficno,directory,local=False): headerfooter.headerwrite(output,"Fic no. " + ficnostring,"Fic no. " + ficnostring + "","",False,local) try: if fileread.original: - makeheader.ficgen(fileread.original,False,output,local) + makeheader.ficgen(fileread.original,False,output,local,True) else: - makeheader.ficgen(ficno,False,output,local) + makeheader.ficgen(ficno,False,output,local,True) except: - makeheader.ficgen(ficno,False,output,local) + makeheader.ficgen(ficno,False,output,local,True) if singlestatus: filewrite = open(output, "a") filewrite.write("