06-10-2012, 09:17 PM | #1 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
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:
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:
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 |
|
06-11-2012, 01:19 AM | #2 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
run your book through an epub to epub conversion in calibre - that puts all styles in alphabetic order & I think it also tidies the display.
it may do other things you don't want - like renaming some styles - though |
06-11-2012, 02:28 AM | #3 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
A solution from a Linux forum. The style sheet to be cleaned is named Brute and is sitting on my Desktop (Bureau).
Code:
roger@lmde64 ~ $ cd ~/Bureau roger@lmde64 ~/Bureau $ sort Brute -o Brute roger@lmde64 ~/Bureau $ sed -i 's/{/{\n\t/;s/:/: /g;s/;/;\n\t/g;s/}/;\n}\n/' Brute roger@lmde64 ~/Bureau $ Spoiler:
To install in the Sigil of tomorrow? Note: The above command adds one ; before the } to make editing easier. Pay attention to this because it could trigger some silent mistakes. If you are unhappy with this, easy, just take out the last ; in the command (the one before the sign } ) Last edited by roger64; 06-11-2012 at 10:48 AM. |
06-11-2012, 02:31 AM | #4 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
cancel
Last edited by roger64; 06-11-2012 at 02:43 AM. |
06-11-2012, 10:52 AM | #5 |
Interested in the matter
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Only Windows: Free CSS Toolbox
http://www.blumentals.net/csstool/index.php |
06-11-2012, 11:35 AM | #6 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
|
|
06-11-2012, 11:47 AM | #7 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Nice free tool. I built a wiki page on our wiki for it.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Re: Aldiko ignoring style sheet property? | purcelljf | ePub | 6 | 11-19-2012 08:15 AM |
How to link the style sheet in Sigil? | JJ Joseph | Sigil | 6 | 06-15-2012 12:49 AM |
Style Sheet editor? | GraciousMe | Sigil | 6 | 06-04-2012 03:06 PM |
An example file of your CSS style sheet | roger64 | Writer2ePub | 6 | 04-11-2012 02:59 AM |
Missing style sheet | mauvais | Barnes & Noble NOOK | 3 | 12-05-2011 06:29 PM |