Skip to content

Draft: Footnotes #107

@samnung

Description

@samnung

Standard support for footnotes. In almost every e-book we do in our company there is at least one group of footnotes. We have implement it in shared files through Bade or Ruby scripts but it is not very robust implementation.

Links

To create link to footnote, just add plain <a epuber-footnote /> tag. epuber-footnote attribute is for Epuber to understand that this link is footnote link. By default it will insert number as content of this tag.

You can create multiple groups of footnotes. To specify group name, just add value to epuber-footnote attribute. For example <a epuber-footnote="notes" />.

To customize the tag you can add any attributes, but do not add href or id, both will be overwritten by Epuber. You can also customize content of the tag, to put the computed number just insert {{ footnote.number }}.

Definitions

To specify definition of footnote (the footnote content), you just need to create div or p tag with attribute epuber-footnote.

Like this:

<footnotes>
  <div epuber-footnote>
    <p class="footnote_first_para">
      <a epuber-backlink class="footnote_backlink">{{ footnote.number }}</a>

      Footnote text
    
      <a epuber-backlink class="footnote_backlink"></a>
    </p>
  </div>
  ... <!-- rest of footnotes -->
</footnotes>

Content of the tag is up to you. To create back links just add <a epuber-backlink> and Epuber will make links back to text (if needed). You can add multiple links in single footnote definition.

Footnotes separated by linked file

Definitions for file text/chapter_01.

<footnotes file="text/chapter_01">
    <div epuber-footnote>
    </div>
    ...
</footnotes>

Definitions for group group-name.

<footnotes group="group-name">
    <div epuber-footnote>
    </div>
    ...
</footnotes>

Definitions for group group-name and file text/chapter_01.

<footnotes group="group-name" file="text/chapter_01">
    <div epuber-footnote>
    </div>
    ...
</footnotes>

Number sequences will be separated for each group or file. <footnote-group /> will not be copied to result, to create grouping in result HTML you have to add another tag inside of <footnote-group />.

Import from existing EPUB

Try to find and parse footnotes when importing. Link will contain only one or more * or just number and id will include keyword footnote.

Config

TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions