Skip to content

Commit

Permalink
use standard footnote format
Browse files Browse the repository at this point in the history
  • Loading branch information
taroxd committed Mar 25, 2019
1 parent 2610655 commit fb2c258
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions epub/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,17 @@ def parse_chapter(tex_str, numbering)

def make_footnote_icon(footnote_id)
<<~ICON.chomp
<a class="duokan-footnote" href="##{footnote_id}"><img class="w10" alt="note" src="../Images/zhu.png"/></a>
<a class="duokan-footnote" epub:type="noteref" href="##{footnote_id}" id="#{footnote_id}-ref"><img class="w10" alt="note" src="../Images/zhu.png"/></a>
ICON
end

def make_footnote(footnotes)
return "" if footnotes.empty?
li = footnotes.map { |content, footnote_id| <<~LI.chomp }.join
<li class="duokan-footnote-item" id="#{footnote_id}"><p class="po">#{content}</p></li>
LI
<<~OL.chomp
<ol class="duokan-footnote-content">#{li}</ol>
OL
footnotes.map { |content, footnote_id| <<~FOOTNOTE.chomp }.join
<aside epub:type="footnote" id="#{footnote_id}" class="po"><a href="##{footnote_id}-ref"></a>
#{content}
</aside>
FOOTNOTE
end

def before_brace(string)
Expand Down

0 comments on commit fb2c258

Please sign in to comment.