Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-12-2011, 04:59 AM   #1
Artha
-----
Artha began at the beginning.
 
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?
Artha is offline   Reply With Quote
Old 07-12-2011, 07:43 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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.
Toxaris is offline   Reply With Quote
Advert
Old 07-13-2011, 06:29 AM   #3
Artha
-----
Artha began at the beginning.
 
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.
Artha is offline   Reply With Quote
Old 07-13-2011, 03:37 PM   #4
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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.
Toxaris is offline   Reply With Quote
Old 07-13-2011, 04:38 PM   #5
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Toxaris View Post
You lost me there. Menu's? Remove CSS? CSS is the best way to format your book.
Ditto.

Hitch
Hitch is offline   Reply With Quote
Advert
Old 07-14-2011, 06:43 AM   #6
Artha
-----
Artha began at the beginning.
 
Posts: 114
Karma: 10
Join Date: Jun 2011
Device: Samsung SNE65
Quote:
Originally Posted by Toxaris View Post
You lost me there. Menu's? Remove CSS? CSS is the best way to format your book.
Nice meeting you. Hope we'll meet again.
Artha is offline   Reply With Quote
Old 07-19-2011, 11:16 AM   #7
saskir
Member
saskir began at the beginning.
 
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.
saskir is offline   Reply With Quote
Old 07-21-2011, 04:25 AM   #8
ghostyjack
Guru
ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.
 
ghostyjack's Avatar
 
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.
ghostyjack is offline   Reply With Quote
Old 07-22-2011, 02:53 PM   #9
Faster
Connoisseur
Faster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of light
 
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>
Check: Regular expressions

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.
Faster is offline   Reply With Quote
Old 07-23-2011, 09:44 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Artha View Post
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?
If I was to remove the CSS of the ePub, THEN it would be unfit for reading on ANY screen.
JSWolf is offline   Reply With Quote
Old 07-24-2011, 11:17 AM   #11
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by Faster View Post
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.
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.
Toxaris is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 02:07 PM.


MobileRead.com is a privately owned, operated and funded community.