Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-06-2010, 05:59 AM   #1
chief
Junior Member
chief began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2010
Device: none
Is it possible to change how Calibre formats HTML for Epubs

I am converting a bunch of files to Epub and Calibre tries to pick up the formatting from the original document by adding Classes to most of the HTML elements.

Is it possible to turn them off so it simply adds <p></p> instead of <p class="calibre1"></p> etc.?

Thanks
chief is offline   Reply With Quote
Old 07-06-2010, 07:32 AM   #2
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
I agree, this would be useful. For now I use Notepad++ as a post-processing tool on calibre generated epubs. It has powerful search and replace facilities which can be applied to all files in a folder and can be used to strip these extra <p> classes across a whole book in one go.
Agama is offline   Reply With Quote
Advert
Old 07-06-2010, 08:42 AM   #3
chief
Junior Member
chief began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2010
Device: none
Thanks Agama, I had a feeling that would be the case. I've been using Sigil for post-processing for this but it adds a whole bunch of time I was hoping to cut out. I hadn't realised I could do this in Notepad++ so might try that to see if thats any easier.
chief is offline   Reply With Quote
Old 07-06-2010, 11:54 AM   #4
nyrath
Addict
nyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfolded
 
nyrath's Avatar
 
Posts: 281
Karma: 52007
Join Date: Jun 2010
Device: nook
Yes, I had a crummy RTF produced by an OCR package which converted to an epub that was rife with class="calibre1" tag attributes. I'll have to give Notepad++ a try.

(People who are willing to spend a bit of money might want to try UltraEdit. Which also can do search-and-replace on multiple files, among many more wonderful features.)
nyrath is offline   Reply With Quote
Old 07-07-2010, 08:10 AM   #5
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
I've also had a play with Sigil and it's quite impressive; a great tool for stripping out unwanted sections/pictures from free epubs, (e.g. Feedbooks), in order to minimize their size. However, I have had trouble with some calibre generated level 3 TOCs within Sigil - they simply didn't show up. The search/replace works well in Sigil but Notepad++ is exceptionally fast and has extended options for matching special characters, (e.g. linefeed, carriage return), and for matching Regular Expressions. It's a good editor for source code as it can colour code syntax for many different file types, including html and xml. There's also a handy macro record/playback facility to do repetitive edits.

I've had a look at the UltraEdit website and their editor looks like Notepad++ on steroids. Could be a good investment if you want the extra features, for example scripts look a really useful tool.

Last edited by Agama; 07-07-2010 at 08:22 AM.
Agama is offline   Reply With Quote
Advert
Old 07-07-2010, 10:34 AM   #6
nyrath
Addict
nyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfolded
 
nyrath's Avatar
 
Posts: 281
Karma: 52007
Join Date: Jun 2010
Device: nook
Quote:
Originally Posted by Agama View Post
I've had a look at the UltraEdit website and their editor looks like Notepad++ on steroids. Could be a good investment if you want the extra features, for example scripts look a really useful tool.
What you said.

Notepad++ is incredibly powerful for a free program. And there are lots of useful plug-ins for it.

If one is doing editing professionally, it might be worth investing in UltraEdit. I use it at my day job for computer programming. It is one of the few programs that I personally found worthy of spending my own money to purchase.
nyrath is offline   Reply With Quote
Old 07-07-2010, 11:10 AM   #7
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by nyrath View Post
What you said.

Notepad++ is incredibly powerful for a free program. And there are lots of useful plug-ins for it.

If one is doing editing professionally, it might be worth investing in UltraEdit. I use it at my day job for computer programming. It is one of the few programs that I personally found worthy of spending my own money to purchase.
How do you find UltraEdit for editing in Python? Does it offer to collapse indented code the way it does for other languages where the code is marked in open/close brackets? Does it highlight code blocks based on indents?
Starson17 is offline   Reply With Quote
Old 07-07-2010, 12:11 PM   #8
Rob Allshouse
Junior Member
Rob Allshouse began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2010
Device: Nook
On the html conversion topic... and CSS

The other change that I have had to made in my books, and would like to see, is line-height: ##em instead of ##px for the main content. In reflow-aware context, moving to a large font size with fixed line-height leads to line overlap. Moving to em allows the spacing to scale with the font size.
Rob Allshouse is offline   Reply With Quote
Old 07-07-2010, 03:04 PM   #9
nyrath
Addict
nyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfoldednyrath reads XML... blindfolded
 
nyrath's Avatar
 
Posts: 281
Karma: 52007
Join Date: Jun 2010
Device: nook
Quote:
Originally Posted by Starson17 View Post
How do you find UltraEdit for editing in Python? Does it offer to collapse indented code the way it does for other languages where the code is marked in open/close brackets? Does it highlight code blocks based on indents?
It is good for Python, although it does not offer function completion like a true IDE (or at least not that I'm aware of). It will collapse code blocks by indent (sort of, it has trouble with finding the end of a block), and has user-definable syntax highlighting. I do not think it highlights code blocks, but there may be a way to make it do that.

Last edited by nyrath; 07-07-2010 at 03:23 PM.
nyrath is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why the font won't change in certain epubs ficbot Kobo Reader 68 10-14-2020 01:54 PM
Calibre Recipe HTML content differs from raw html of index.html. krunk Calibre 4 09-20-2010 09:48 PM
Reader Device Change - Re-Convert all Epubs? sjfwhite Calibre 2 06-24-2010 10:55 AM
How to change the Fonts for ePubs diokdin Calibre 3 04-19-2010 09:31 PM


All times are GMT -4. The time now is 03:42 PM.


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