XHTML change
The first application is to rewrite XHTML to include a comment, and rebuild the EPUB. It probably makes sense to use the <aside> element for notes along with the epub:type='footnote' attribute epub:type='footnote' . If you then add a link to the page somewhere (for example, around the text to which the comment refers), with the epub:type='noteref' , then iBooks will work correctly. See http://www.pigsgourdsandwikis.com/2012/05/creating-pop-up-footnotes-in-epub-3-and.html .
<p>This sentence contains a <a href="#note" epub:type="noteref">commented phrase</a>. </p> <aside id="note" epub:type="footnote">This is the comment.</aside>
However, standard markup will not work in all e-book readers. The best you can do is add a script that issues the corresponding note, but this will obviously only work in scripted EPUB3 e-books read on a reader that runs the scripts.
Using CFI in a separate file
A possible alternative that avoids overwriting XHTML files is to save comments in a separate file and link them to the corresponding text using canonical fragment identifiers ( http://www.idpf.org/epub/linking/cfi/ ). But of course, you still need a script to make things work. The file may look like this:
<comments> <comment> <cfi>/6/4[chap01ref]!/4[body01]/10[para05]/3:10</cfi> <text>This is the comment.</text> </comment> </comments>
You can find the CFI implementation prototype at https://code.google.com/p/epub-revision/source/browse/trunk/src/samples/cfi/epubcfi.js , but you still have to write glue around it.
user663031
source share