Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 07-29-2019, 03:01 PM   #16
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: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
@MistaPrime,

There is a solution to your problem. Don't convert. Use the Calibre eBook editor to edit the HTML and make it into an eBook. It's not all that hard to do. Do you know how to do it?
JSWolf is offline  
Old 07-29-2019, 04:55 PM   #17
MistaPrime
Member
MistaPrime began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2019
Device: EPUB
Quote:
Originally Posted by JSWolf View Post
@MistaPrime,

There is a solution to your problem. Don't convert. Use the Calibre eBook editor to edit the HTML and make it into an eBook. It's not all that hard to do. Do you know how to do it?
I'm not too sure what you mean.
Is it the "Edit Book" icon in the top right corner?
Doesn't it have to be already in ePub format?
MistaPrime is offline  
Advert
Old 07-29-2019, 06:42 PM   #18
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: 79,796
Karma: 146391129
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 MistaPrime View Post
I'm not too sure what you mean.
Is it the "Edit Book" icon in the top right corner?
Doesn't it have to be already in ePub format?
Possibly. Another editor you can use is Sigil. I know for sure that you don't have to start with an ePub.
JSWolf is offline  
Old 07-29-2019, 07:11 PM   #19
Bookstooge
Member Retired
Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.Bookstooge ought to be getting tired of karma fortunes by now.
 
Posts: 805
Karma: 2091358
Join Date: May 2019
Device: Kindle Oasis 1st Gen, PB Era
Sigil definitely can edit html files. I have not used the Calibre editor but I seem to remember someone posting questions about it somewhere and html came into the equation, so my vague, hazy recollection is that you CAN edit html files with the calibre editor.
Bookstooge is offline  
Old 07-29-2019, 07:50 PM   #20
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,745
Karma: 30237526
Join Date: Mar 2012
Location: Sydney Australia
Device: none
You can use the calibre Book Editor independently of Library Management

On Windows you can get at it via the Start panel, viz:

Click image for larger version

Name:	Annotation 2019-07-30 094517.jpg
Views:	182
Size:	55.9 KB
ID:	172677

And from there you can import an HTML file

Click image for larger version

Name:	Annotation 2019-07-30 094118.jpg
Views:	182
Size:	73.6 KB
ID:	172678

BR
BetterRed is online now  
Advert
Old 07-30-2019, 01:51 AM   #21
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,391
Karma: 169098492
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by MistaPrime View Post
Indeed, I was planning on adding a stylesheet/CSS to Calibre's custom CSS option.
Thanks for your suggestion, I appreciate that.
You're welcome.

Quote:
Originally Posted by MistaPrime View Post
The HTML above was found by Googling "footnote styles", I frankly didn't even notice it was from a Gov site but that does prove a bigger point, that even larger sites do not use <sup> in their HTML.
Very likely because their programmers understand the use of cascading style sheets and how useful they are to replace endless in-line styles -- you did notice the 3 stylesheets linked at the start of the HTML snippet? Anytime you want consistency between segments of your site when multiple people are maintaining it, common stylesheets are among your best friends. Yes, you can use inline styles, you can declare styles at the start of every HTML file but anyone who uses those techniques instead of a linked stylesheet is living in the '80s.

If you had downloaded the stylesheets associated with that page and placed them in the HTML archive, the footnote class would have been preserved and used.

Edit: I tested this by using Firefox's Save Page As on Legislative Summary of Bill C-99: An Act to amend the Citizenship Act, saving the result as a .zip file which I imported into calibre and then converted to epub. See the snippet of the epub open in PageEdit attached as an image. Notice the footnotes references are superscripted. The exact stylesheet structure was not preserved due to calibre's love of flattening stylesheets but the intent was preserved.

Quote:
Originally Posted by MistaPrime View Post
Regarding the competency level comment, I am not good at reading between the lines but if you are attempting to judge my competency in HTML based on the request above, you may want to re-read the request.
I would question the competency of anyone as a web page/HTML programmer or epub creator who did not realize that a style pointed at by a class= must exist to be of any use. Much as I would question the competency of a person who dropped a fish into an empty aquarium and then complained it was not swimming around.

Quote:
Originally Posted by MistaPrime View Post
Thanks for the input, your help has been greatly appreciated.
Good luck!
Attached Thumbnails
Click image for larger version

Name:	snippet.png
Views:	183
Size:	107.4 KB
ID:	172682  
DNSB is offline  
Old 07-30-2019, 09:10 AM   #22
MistaPrime
Member
MistaPrime began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2019
Device: EPUB
Quote:
Originally Posted by DNSB View Post
You're welcome.

I would question the competency of anyone as a web page/HTML programmer or epub creator who did not realize that a style pointed at by a class= must exist to be of any use. Much as I would question the competency of a person who dropped a fish into an empty aquarium and then complained it was not swimming around.

Good luck!
Did you really conclude that after reading this request?
Maybe the competency you should question is your own reading comprehension.

The request is not debating if a class is being associated with CSS or not. The class I mentioned could have been associated with a JS for all we care, used or not used.
What is in question here is the repeated request to keep a class regardless of it's use.

Calibre ads classes, but what if someone wants to keep a class for an unknown use? Rather than having to edit the HTML on thousands of imports, Calibre could simply exclude one class from being removed. Even if that class is associated with any CSS or JS. That to me is a pretty reasonable request. I didn't have to listen to you questioning my competency or another user assuming that I am getting paid by a client.

Thanks for the help really, but keep your derogatory assumptions to yourself and work on your reading comprehension.
MistaPrime is offline  
Old 07-30-2019, 09:12 AM   #23
MistaPrime
Member
MistaPrime began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2019
Device: EPUB
JSWolf, Bookstooge, BetterRed, thank you guys. I will definitely look into Sigil, perhaps it can ommit the removal of classes.

Thank you, I really appreciate the help and generous support of this community. It has exceeded my expectations. I will definitely try to give back by helping others on here once I figure out more on how this works.
MistaPrime is offline  
Old 07-30-2019, 09:30 AM   #24
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,079
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Been there (my first HTML was in 2000), when CSS had not been invented.

Take time and get your head wrapped in the CSS concept. For most ebooks, it is really simple. I learned by reversing early Baen Webscriptions.

Basically: design IT. Control IT (from a single place. The CSS). Use (reference) IT through out your document.

Code:
/*CSS most simple */
body {}
h3 {}
p {}
/*add if used in your doc */
sup {}
sub {}
blockquote {}
You put your control attributes inside the { } for the tag level item.

Need an exception to the basic rule. add class="except-name" to the tag on the document
the CSS gets an entry (these always start with/have a dot in the CSS )
Code:
.except-name { }
BTW both Calibres and Sigils Editor include a Code Inspector
Calibre you turn it on from the Editors view menu, It will appear at the bottom, and may need to be resized to be of use as it does not seem to detach. Sigils version: you use the Flashlight Icon to activate the Inspector on the selected block.
Even Firefox has it for decoding web page code (ctrl-shift-C)

The whole point is to control each style (look) from a single place, rater than multiple places.
theducks is offline  
Old 07-30-2019, 09:44 AM   #25
MistaPrime
Member
MistaPrime began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2019
Device: EPUB
The request is pretty simple, no need to assume that someone doesn't know what CSS does. Maybe I should have formulated the request differently.

Assume you are an Android developer which will make an app for ePUBS. That app will do things with the ePUB such as animations. And that app will depend on classes in the HTML, there is no CSS. CSS is not relevant.

Your HTML has classes already and you want to keep those classes, at least one class.
But you have thousands of HTML files that you cannot edit.

How do you tell Calibre to not remove that one class?

From what I understand that option is not available in Calibre.
Calibre seems to remove all classes it thinks are not necessary. You are out of luck if you think that one class is necessary and Calibre doesn't think so.

Would it be difficult to introduce that option into Calibre?
Just a field where you enter a class name, and based on that field Calibre doesn't remove that class.

Am I the first one to request this feature? It seems reasonable to keep a class in an ePUB and I can think of millions of reasons why someone would want to keep a class.
MistaPrime is offline  
Old 07-30-2019, 10:04 AM   #26
MistaPrime
Member
MistaPrime began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2019
Device: EPUB
Quote:
Originally Posted by theducks View Post
Been there (my first HTML was in 2000), when CSS had not been invented.

Take time and get your head wrapped in the CSS concept. For most ebooks, it is really simple. I learned by reversing early Baen Webscriptions.
Oh boy, thanks for the input.
At this point I think I need to start a new thread.

I gotta re-phrase the request in the next topic. This will be the title:
CSS not relevant, forget about CSS or JS. How to tell Calibre to keep a class, without editing HTML.

Pretty simple request really.

I can think of a million reasons why someone would want to keep a class in the HTML once converted into EPUB.

What if you are an app developer for Android who wants to animate specific words when the app is viewing the ePUB? You would need classes to be kept after conversion.

Calibre removes all classes that are not used by the file's stylesheets. I can think of a million reasons why someone would want to keep a class and not mention it in the stylesheets.

As a matter of fact I have made in the past a webapp which had classes only for when the pages were viewed by it's Android app. The classes are used only in the app, not in stylesheets or in the JS of the page.
There are millions of HTML pages, and examples where a class is not used by CSS stylesheet.

I am sure someone could add that to Calibre, just one field that says this:
Input class name here which you do not want to be removed during conversion.

I can't believe I am the first user offering that suggestion, I am sure others have struggled with this.
MistaPrime is offline  
Old 07-30-2019, 10:31 AM   #27
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,379
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I cant think of a single reason to keep useless classes in HTML, let alone a million. And no calibre is not going to do that. If you wish to annotate HTML with metadata use the data-* attributes, its what they are for, and calibre will not touch them.
kovidgoyal is offline  
Old 07-30-2019, 10:33 AM   #28
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,379
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Oh and since you seem to be determined to argue for the sake of arguing, here is how you actually fix your problem, which IIRC was to get superscripts to display aligned. Add the following to the extra CSS option in the calibre conversion options under Look & feel


Code:
.footnote { vertical-align: super }
and magic! your footnotes will be vertically aligned.
kovidgoyal is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pseudo classes to be deleted as unused classes Leonatus Sigil 2 09-23-2018 09:12 AM
docx to epub - obsolete classes for italic and bold krbo Conversion 2 01-09-2014 05:44 AM
CSS classes on Android epub readers MarleneW ePub 7 05-13-2012 04:57 PM
txt to Epub - adding classes with textile Nareshkendel Conversion 4 11-23-2011 05:30 PM
Why, During ePub to ePub Conversion does Calibre changes existing CSS classes? JSWolf Conversion 7 08-06-2011 07:32 PM


All times are GMT -4. The time now is 12:00 AM.


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