View Single Post
Old 01-06-2014, 10:54 AM   #5
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 698
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by kovidgoyal View Post
As I mentioned in the gigantic how to make sigil thread, adding a programmatic way to split a file in multiple locations at once is on my todo list, but it will use XPath, not regex.
So, then would it work like chapter detection works in Calibre?

If so, given an epub in which the whole book is in one file, could I insert, say,

Code:
<hr class="chapter-spllit" /hr>
at the points I want to split, and then use an xpath expression something like

Code:
//h:hr[re:test(@class, "chapter-split", "i")]
so that it would split the file at all the indicated points?

(And hopefully naming them something like "split_1", split_2" ... rather than "split_1", "split_1_1" ... since there could be (usually would be) several dozen splits.)

That would work for me.
st_albert is offline   Reply With Quote