Cleaning a stylesheet of unused styles
Hi
I am not sure this belong to the Sigil forum. Please forgive me if I am mistaken.
Ideally we all have clean style sheets. Nearly always. Sometimes, though, from a badly formatted file, after using a too trusting and not enough discriminating converter, some (many) unused styles land in the style sheet and clutter it.
As a prevention tool, just before publishing, I'd like to be sure that my style sheet contains only styles that are really used in the html files and to be able to discard the others.
I can imagine for example a script or a tool, parsing the style sheet, then counting and summing up the occurrences of styles in the html files. After that, a style showing 0 occurrence could probably be safely deleted.
Maybe there could be other solutions?
|