I replace all headers on all html files as a matter of course using Sigil’s “Tools/Add Cover” and then regex.
- Add a new cover, this puts the correct header for the type of ePub (version 2 or 3). You can also set a template file (“cover-template2.xhtml” or “cover-template3.xhtml”) with any special coding that you like into Sigil’s preferences folder that will be used by Sigil. (See the users manual)
- I then link the stylesheet to that new cover file.
- I choose to put the title of the book in the <title> tag but it is preferable to put more detailed info to meet accessibility standards - I usually do this as one of the last steps in the production.
- I then use a basic regex to replace all the headers with the one from the new cover page. First, highlight and copy (ctrl-c) the entire header from the beginning to, and including, the </head> tag. Then use the following regex:
Code:
Find: .*?</head>
Replace: paste (ctrl-v) the header you copied here.
Make sure you have regex mode, “All HTML Files”, and “Dot All” selected in the Regex Options.
I set the find code as a clip in Sigil so I don’t have to type it every time. This all takes a couple of seconds for each book.