Any way to modify HTML head section?

I need to transform a project into an HTML website, the texts being separate pages, and I wonder if there is a way to add or replace something in the HTML head section. My piece of code would, for example, replace whateverishere part in the output. I doubt if Replacements in the Compile options are capable of this. I also assume the compile won’t allow me to have separate files like when exporting. When exporting, however, I don’t see any way of modifying the HTML head section.

There isn’t anything in Scrivener that would help you out here. Maybe you could compile to the ePub format and then extract the .xhtml files out. But that would almost certainly require some post-processing as well. The main advantage you would get is one file for every “page break”, and internal links updated to cross-reference between those files. Honestly, I’m not sure if that is any easier than just compiling an HTML file and finding a utility that can split by a header level or something. It seems like the kind of thing that someone has created, somewhere. :slight_smile:

I am able to achieve what I want by selecting in Preferences / Import/Export -> Export Options -> HTML -> Styling: No CSS, and after exporting mass replacing some text with one TextFinderX. TextFinderX supports also wild-cards, which I didn’t know earlier.

What is very helpful about Scrivener is that you can export several files at one time and they’re nicely named and put in the same folder. My project is kind of hypertextual and I need to export to HTML for test purposes. The final version needs to be a compiled RTF however. Scrivener handles both.

Thank you for the answer anyway. I suppose this kind HTML modification is not a feature to consider in Scrivener?

It’s one of those “would be nice” things that is sadly mostly impossible. We’re just asking the Apple text engine to turn your text into an HTML file. It is 100% responsible for the process, and we don’t really have any hooks into it.