Your best bet is to write a script that uses a stream editor like sed to extract the style tag from head in each xhtml file and replace it with a link to a new stylesheet you will fill with the extracted styles, one for each xhtml file.
Alternatively, you can readily do this in a plugin since they support a number of parsers including quick parser, gumbo, and bs4.
|