Quote:
Originally Posted by MistaPrime
What if you had a client that that has thousands of pages that you cannot change? Which is in this case.
The links in the HTML are with a class footnote, it does not have a <sup> tag. And the HTML cannot be changed.
Calibre should be able to keep the class footnote in the link if we ask it to. Otherwise I am looking at manually editing thousands of pages just to make it work with Calibre.
The class footnote is used in a different stylesheet but that is not relevant. Calibre should leave the class footnote alone if we tell it to.
If a class is needed, it should have that option.
So far the best solution is the CSS offered by user Brett Merkey.
But that is not a solution for the long term.
Please give Calibre an option to keep a class if we mention that class.
|
As the title of this thread states: HTML to EPUB, how to keep classes?"
If you have a class in a stylesheet, calibre will not remove it fom the HTML files. If you don't have a class used in the HTML that is not in a stylesheet, it is an unused reference and will be removed. Even if calibre left an unused class in the HTML, it would not work since there is no stylesheet to supply the information for that class. This leaves out calibre's habit of flattening stylesheets but that still leaves a class in the HTML. Or are you planning to adding a stylesheet into the epub after using calibre to create it in a frenzy of manual editing?
So stop trying to convert a naked HTML file to an epub. What you should be doing is generating a file with the HTML and CSS files so calibre has that information available. You can download the webpage and add the files into a .zip file and then use calibre on that .zip file to generate an epub which includes the HTML and CSS (plus any downloaded images, etc.) which you then edit to remove the cruft.
Edit: I noticed you used the term "we" and not I several times in your posts. Given that the HTML you posted appears to be from a Canadian government site, you should consider hiring someone semi-competent. Someone who might understand a a webpage is not just the raw HTML files but the supporting code (CSS stylesheets, javascript, etc.).