Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Show custom footnotes in epub output.
  • Loading branch information
calcnerd256 committed Mar 21, 2016
1 parent aea681d commit 7e7968e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Skripten/EOAconvert.py
Expand Up @@ -1548,15 +1548,16 @@ def bring_footnote_down_epub(footnote, footnote_name, destination):
kids = list(footnote.getchildren())
if len(kids):
first_child = kids[0]
first_child.text = "[%s]%s" % (footnote_name, (first_child.text or ""))
first_child.text = "[%s] %s" % (footnote_name, (first_child.text or ""))
replace_footnote_with_sup(footnote)
footnote.text = "[%s]" % footnote_name
footnote.text = "[%s] " % footnote_name
for kid in kids:
destination.append(kid)
return contentopf


for xmlChapter, groupings in zip(xmlChapters, bigfoot_data):
for xmlChapter in xmlChapters:
groupings = get_bigfoot_data(xmlChapter)
xmlFootnotes = xmlChapter.findall(".//note")
if len(xmlFootnotes) == 0:
if not len([note for grouping, notes in groupings for note in notes]):
Expand All @@ -1571,7 +1572,10 @@ def bring_footnote_down_epub(footnote, footnote_name, destination):
footnote_name = str(index + 1)
if "lower-latin" == grouping:
footnote_name = alph_fndex(index)
contentopf = bring_footnote_down_epub(note, footnote_name, xmlNewFootnotes)
para = etree.Element("p")
para.text = "[%s] %s" % (footnote_name, note.text)
contentopf = bring_footnote_down_epub(note, footnote_name, para)
xmlNewFootnotes.append(para)
notes_so_far += len(notes)
intFootnoteNumber = notes_so_far + 1
for xmlFootnote in xmlFootnotes:
Expand Down

0 comments on commit 7e7968e

Please sign in to comment.