View Single Post
Old 02-25-2011, 08:39 AM   #5
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Right, I've done it with the small example given.
It's three Search and replaces, Two on the orig markdown text file, then when converted to epub, a S&R done in Sigil

Also, the footnotes have to be seperated by blank lines, instead of on following lines as in example.

Open the original markdown txt file
Search
Code:
^\[(\d+)\](\S+)
Replace
Code:
<sup>\1</sup><a id="fn\1" href="#fnr\1">\2<a>
Edit: replacing all occurences

Then
Search
Code:
(\S+)\[(\d+)\]
Replace
Code:
\1<sup><a id="#fnr\2" href="#fn\2">\2</a></sup>
Edit: replacing all occurences

Save file, convert with calibre to epub, Using pagebreak in structure detection with default Xpath expression, so each story would the be in their own file.

Then open in Sigil,
Search
Code:
../Text/index_split_000.html
Replace with nothing.

Edit: replacing all occurences in CodeView, and replace in all files


Save, you should then have the correctly done file.

Last edited by Perkin; 02-25-2011 at 08:41 AM. Reason: Added info
Perkin is offline   Reply With Quote