View Single Post
Old 10-24-2015, 07:42 AM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,797
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by 1v4n0 View Post
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

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:

Click image for larger version

Name:	Image1.png
Views:	977
Size:	100.6 KB
ID:	143133

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.

Click image for larger version

Name:	Image2.png
Views:	566
Size:	105.3 KB
ID:	143134

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
RbnJrg is offline   Reply With Quote