I use Linux primarily; this is what I use sometimes; it's hackish, not so elegant and it doesn't take into account css rules for HTML tags, e.g.:
h2 {font-size: xx-large;}
so only css rules for .foo in e.g. <h2 class="foo">.
Code:
$ cd OEBPS/Text
$ pcregrep -o -h 'class=".+?"' * | sort -u | perl -p -e 's/class="//' | perl -p -e 's/("\n| )/|/' | perl -p -e 's/\|$//g'
this should produce a list of the css styles used in the html/xhtml files, something like:
Code:
ach1|acl|bmh|byline|cn|cotx|crt|crt1|crt2|custom1|da|ded|ded1|di|dia|dropcap|dt|dt1|dt3|dt4
then cd to the Styles dir and:
Code:
$ cd ../Styles
$ STRING="(ach1|acl|bmh|byline|cn|cotx|crt|crt1|crt2|custom1|da|ded|ded1|di|dia|dropcap|dt|dt1|dt3|dt4)"
$ pcregrep -N ANY -M '\.'$STRING'\s*?\{(\s*.+?)+?\s*\}' *.css
this should print all the css rules that are actually used in the book.