Automate a page split... Find & Replace doesn't work for this
I've been trying to find a way to split a page before every <h1> heading & before & after every image with the word "insert" in the name.
I have found many results but all of them end up saying the same thing "use Regex/Find & Replace" &/or "add a Page Break" but the problem is that I'm not just needing to replace some text in a page, rather what I need is to take a page & split it right before a set, repeated entry. Some of the topics I found seemed to be asking the same thing but were not clear enough to prevent misunderstanding & just seem to end with the answering party believing they solved the problem.
What I am currently doing is just a Find for <h1> & clicking before the found text & selecting Edit > Split at Cursor. I then do another search, this time for <img &, after looking at it to be sure it's an image that is intended to be on it's own page, splitting at cursor before & after the image. I then go & rename the pages, with a set pattern, the image pages are named what the image is "insert1", "insert2", etc, the ones that start at headings are named "ch#_" with the consecutive number to the previous one, (usually starting at "0" if there's a "Prologue" chapter but if an automation would require it to always start at 1 I'm fine with that too), followed by the chapter's 1st 7 non-whitespace characters in the <h1> name.
Is there any way to shorten this process? I have a saved search for the 2, but the time that saves seems to be none, only really helping in the potential future where I won't have to remember what to search for.
I'm new to Sigil, & feel I must be missing something because this seems like regular things people would want to do, but all my searches just seem to go cold with the same non-answer.
|