View Single Post
Old 06-10-2012, 09:17 PM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 1,417
Karma: 846401
Join Date: Jan 2009
Device: KoboGlo
Alphabetize and clean a style sheet

The last question of this kind I asked for allowed me to find a very useful tool, so I try again...

Two days ago, I naively asked meme which tool he used to produce such a clean style sheet for his Sigil user guide. The reply was sweat, blood and tears (nearly ).
Quote:
Originally Posted by meme View Post
Entirely manually, and gradually building up by adding, and removing, as needed.
The converter I use produce automatically CSS style sheets of this kind (see spoiler). As you can see, styles are placed, each on their own line, and sometimes this line can be un-pretty long, which creates blocks difficult to read and debug.
I would like to use a tool to do three things:
1. - Put this style sheet in alphabetical order.
2. - Processing style after style, provoke a line change (like \n in OO) after these two signs: { ; and before and after this tricky one: }
3. - Any other idea(s) to improve it further, including skipping a line after each style.

Has anybody already realized such a tool?

Spoiler:

Code:
body {font-family:'Times New Roman'}
span.smcpIncise {font-family: 'LinuxLibertineOCRegular';font-style:normal}
span.smcpTypeA {font-family: 'LinuxLibertineOCRegular';font-style:normal; margin-left: -1em}
span.smcpTypeV {font-family: 'LinuxLibertineOCRegular';font-style:normal;margin-left: 0em}
a:link {color:#000080;text-decoration:underline}
p.smcpCentrage {margin-left:0.0cm;margin-right:0.0cm;margin-top:0.499cm;margin-bottom:0.499cm;border:none;padding:0;text-indent:0.0cm;text-align:center;font-family: 'LinuxLibertineOCRegular';font-size:83%}
p.Italdroite {margin-left:0.0cm;margin-right0.499cm;margin-top:0.499cm;margin-bottom:0.499cm;border:none;padding:0;text-indent:0.0cm;text-align:right;font-style:italic;font-weight:normal;font-size:83%}
p.let {margin-left:0.0cm;margin-right:0.0cm;margin-top:0.0cm;margin-bottom:0.0cm;border:none;padding:0;background-color:transparent;text-indent:0.0cm;text-align:justify}
p.smcpDroite {margin-left:0.0cm;margin-right:0.499cm;margin-top:0.499cm;margin-bottom:0.499cm;border:none;padding:0;text-indent:0.0cm;text-align:right;font-family: 'LinuxLibertineOCRegular';font-style:normal;font-weight:normal;font-size:83%}
p.Centrage {margin-left:0.0cm;margin-right:0.0cm;margin-top:0.499cm;margin-bottom:0.499cm;border:none;padding:0;text-indent:0.0cm;text-align:center;font-size:83%}
p.Textbody {margin-left:0.0cm;margin-right:0.0cm;margin-top:0.0cm;margin-bottom:0.0cm;border:none;padding:0;background-color:transparent;text-indent:0.9cm;text-align:justify}
p.Header {margin-left:0;margin-right:0;margin-top:0.6cm;margin-bottom:0.6cm;border:none;padding:0;text-align:center;font-style:italic;font-weight:normal;font-size:83%}
h2 {page-break-before:always;margin-left:0.0cm;margin-right:0.0cm;margin-top:1.499cm;margin-bottom:0.601cm;border:none;padding:0.0cm;text-indent:0.0cm;text-align:center;font-family:'Times New Roman',serif;font-style:normal;font-variant:normal;font-weight:normal;text-decoration:none;text-transform:none;clear:left}
.frameGraphics {margin-left:0;margin-right:0;margin-top:0;margin-bottom:1em;border:none;padding:0}
.frameFrame {margin-left:0.201cm;margin-right:0.201cm;margin-top:0.201cm;margin-bottom:0.201cm;border:0.05cm solid #000000;padding:0.15cm}
.frameGraphics p {margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}
.frameFrame p {margin-left:0.201cm;margin-right:0.201cm;margin-top:0.201cm;margin-bottom:0.201cm}
body {background-color:transparent}

As you all know better than me, the target would thus be like this
Code:
span.smcpIncise {
  font-family: 'LinuxLibertineOCRegular';
  font-style:normal
}

Last edited by roger64; 06-11-2012 at 03:01 AM. Reason: sweat
roger64 is offline   Reply With Quote