![]() |
#1 |
-----
![]() Posts: 114
Karma: 10
Join Date: Jun 2011
Device: Samsung SNE65
|
Removing class and id references
I usually end up removing the CSS of epubs as it unfit for a small screen anyway. But I am left with a HTML spiked with mostly class and id reffereces to undefined values. All I need is the headings for the TOC and maybe some tags for empasys, nothing more. Can Sigil clean up the HTML?
|
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You're better of updating the CSS to a better version....
However, you can remove a lot of tags with some relative simple RegEx S&R. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
-----
![]() Posts: 114
Karma: 10
Join Date: Jun 2011
Device: Samsung SNE65
|
I thought there might be something to clean up the code in Sigil. CSS like that should not be cleaned - should be removed as quickly as possible. While IDs might have a need for something particular, classes mean the reader should parse over and over the same text for tweaks. Sure, in the web world you might separate menus from the body, yet in a book there's no need for all that hassle.
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You lost me there. Menu's? Remove CSS? CSS is the best way to format your book.
|
![]() |
![]() |
![]() |
#5 |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
-----
![]() Posts: 114
Karma: 10
Join Date: Jun 2011
Device: Samsung SNE65
|
|
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 14
Karma: 10
Join Date: Nov 2010
Device: Sony PRS 650
|
I don't know you personally but from the two threads I have seen from you arised one question: Why does he want to do this this way (don't take it personally, this was just my two cents)?
But for your question: I know no easier way than to simply put the id/class in the search and replace field (like the person in the second post wrote) and then overwrite it. Example "<p class="whatever">" with "<p>". Don't forget that you need to be in the code view for this and that you need to check "in all HTML files" (is a drop down menu). As said I don't understand why you want this but everyone has their preference. For example: How are you formating bold or italic text? In the HTML? Wouldn't it be easier to define a class and use it? If you remove all classes you get virtually everywhere the same formating. |
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
|
I also don't understand the point in removing the CSS. I would keep it and tidy up the formatting to make it cleaner.
I use it all the time and I read alot on my HTC Desire HD's 4.3 inch screen and it doesn't take much effort to fix the formatting (with CSS included) to display correctly. IF you are intent on removing all tags, then in Sigil there is an option in the Format menu to remove formatting. So highlight the text and then either go to the menu option or use Ctrl+Space to remove the formatting. Just remember this will strip out everything in the selected text (if you select an entire paragraph it will put it to just the <p> </p> tags) so you will need to add back in anything that you want to retain manually. |
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 61
Karma: 12096
Join Date: Sep 2010
Location: Tasmania
Device: Sony PRS 650
|
I'm sure Artha is able to speak for himself but here's my tuppence worth:
Some posters' comments are confusing formatting and needing a CSS. x)html has built-in formatting :- h1-h6, b, i, or variants and so on, plus a default font, paragraph spacing, indents or lack of, what-have-you. If a person is happy with what this restricted set of formatting generates for their reader then that's it! His business, not yours. As to removing the unwanted stuff: Code:
Find: <p[^>]*> Repl: <p> Not sure if you really want to remove the IDs if you want to retain the TOC. If you do, play around with the F/R above. Maybe replace the 'p' in the Find box with 'id' and leave Replace blank. |
![]() |
![]() |
![]() |
#10 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,224
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Sorry, it is you that is confused. The tags in xhtml are there for structure. You can influence the layout with a stylesheet. That most of the tags have a characteristic appearance in a browser, is because that browser decides to render those tags to specific formatting.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-650 SD Card Importance? SDHC, SDHC Class 4, Class 10 etc is it important | Renji | Sony Reader | 11 | 12-03-2011 12:30 PM |
Removing files, cleaning up references | Artha | Sigil | 11 | 07-19-2011 11:05 AM |
Changing or removing <div class="calibrenavbar"> | ptsefton | Recipes | 3 | 05-28-2011 08:30 AM |
Trouble removing span class | mufc | Recipes | 3 | 03-18-2011 03:29 PM |
Unutterably Silly Why all the Lovecraft references? | Mobile Mason | Lounge | 3 | 12-03-2009 12:53 PM |