Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-24-2015, 07:05 AM   #1
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
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
1v4n0 is offline   Reply With Quote
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,542
Karma: 6613969
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:	870
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:	514
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
Old 10-24-2015, 07:58 AM   #3
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
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
1v4n0 is offline   Reply With Quote
Old 10-24-2015, 08:06 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,551
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.
DiapDealer is offline   Reply With Quote
Old 10-24-2015, 08:09 AM   #5
1v4n0
Groupie
1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.1v4n0 writes the songs that make the whole world sing.
 
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.
1v4n0 is offline   Reply With Quote
Old 10-24-2015, 10:08 AM   #6
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Quote:
Originally Posted by 1v4n0 View Post
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
The link isnt correct even before the split. In Sigil, each (x)html file is underneath /Text so the link must be

../Text/01.xhtml#a
rubeus is offline   Reply With Quote
Old 10-24-2015, 12:23 PM   #7
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by 1v4n0 View Post
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?
Yup, that could be a reason.
Toxaris is offline   Reply With Quote
Old 10-24-2015, 12:57 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,805
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
theducks is online now   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 01:35 PM.


MobileRead.com is a privately owned, operated and funded community.