10-24-2015, 07:05 AM | #1 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Split an EPUB into more HTML files
Hello, is there a way to split an XHTML file within an EPUB into more files (for example before the headings), while keeping all the correct internal links, such as notes and TOC?
I know I could do this by converting from EPUB to EPUB with calibre, but is there a cleaner way? Ty |
10-24-2015, 07:42 AM | #2 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Yes, you can. Just open the epub, set the cursor where you can split the .xhtml file and then go to Edit/Split at Cursor. See the picture below: Another method is by inserting a split marker. Set the cursor where you want the .xhtml file splitted and then go to Insert/Split Marker. Once you have inserted all split marker you want, press F6 (or go to Edit/Split at Marker). With this last method and a bit of regex you can split an epub very easily. For example if you want to split the epub before any <h2> tag, you only have to S&R with: Search: <h2 Replace with: <hr class="sigil_split_marker" /><h2 And that's all. If you want to add split markers with more precition (for example with <h> tags with some class or something similar), you'll need to use regex in S&R. Regards Rubén |
|
Advert | |
|
10-24-2015, 07:58 AM | #3 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Hmm, this does not update the internal links.
If something pointed to "../01.xhtml#a" I want it to point to the file where that "a" ID now finds itself. Is this even possible? TY anyway |
10-24-2015, 08:06 AM | #4 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
When splitting/merging, the internal links are adjusted automatically. There'd be little point in making the split/merge so easy to do if you then had to manually fix all the links.
Just try it with a sample epub and see. |
10-24-2015, 08:09 AM | #5 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
EDIT: It works. No idea what was wrong before. Ty all guys!
Hmm then something is missing in what I do, because the links are not updated. Could it be BC the IDs are with numbers only, something that the validator tells me is no good? Last edited by 1v4n0; 10-24-2015 at 08:50 AM. |
Advert | |
|
10-24-2015, 10:08 AM | #6 | |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Quote:
../Text/01.xhtml#a |
|
10-24-2015, 12:23 PM | #7 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
|
10-24-2015, 12:57 PM | #8 |
Well trained by Cats
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Always split in codeview so you can see that you are splitting between Block level tags. Sigil will replicate the needed surrounding tags in the new file.
Sigil will also 'lose' the filename portion of a link if the target file is deleted beforehand. ../Text/foo.xhtml#mid becomes ../Text/#mid which will fail to validate |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there a quick way to split large html files? | cager | Editor | 4 | 04-08-2014 08:10 AM |
How to automatically split (x)html in epub? | osnova | ePub | 15 | 03-13-2012 06:00 PM |
[Old Thread] Avoid epub split in several html files? | mastroalex | Calibre | 18 | 12-03-2011 03:50 PM |
[Old Thread] mergin split html files with Calibre? | NASCARaddicted | Conversion | 13 | 12-03-2011 01:19 PM |