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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2021, 04:12 AM   #1
The_book
Connoisseur
The_book began at the beginning.
 
Posts: 85
Karma: 10
Join Date: Aug 2019
Device: none
How to convert to an Epub file without css and class?

I hope that the converted epub file does not contain any format other than html tags, that is, no class and css. What should I do?
The_book is offline   Reply With Quote
Old 05-12-2021, 08:37 AM   #2
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: 26,322
Karma: 41365351
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
Just Convert and see
Most browsers (book viewers) have built in defaults for common tags.

If you don't like what you see, then add a CSS to put your spin on the tag.
theducks is online now   Reply With Quote
Advert
Old 05-12-2021, 08:40 AM   #3
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: 63,347
Karma: 103125649
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by theducks View Post
Just Convert and see
Most browsers (book viewers) have built in defaults for common tags.

If you don't like what you see, then add a CSS to put your spin on the tag.
If the eBook has inline styles, then those will be converted to CSS and can be edited from there as needed.
JSWolf is offline   Reply With Quote
Old 05-12-2021, 09:02 AM   #4
The_book
Connoisseur
The_book began at the beginning.
 
Posts: 85
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by theducks View Post
Just Convert and see
Most browsers (book viewers) have built in defaults for common tags.

If you don't like what you see, then add a CSS to put your spin on the tag.
What I mean is, for example, when I convert a txt/markdown file to Epub by Calibre, class and css will be added by Calibre. Is there a opinion in Calibre that I can use to convert to a Epub without css and class?
The_book is offline   Reply With Quote
Old 05-12-2021, 09:13 AM   #5
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: 63,347
Karma: 103125649
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Why do you want an ePub with no CSS? The defaults are not all good. You do need CSS to fix up some of the defaults.

You really should not be trying to do ePub with no CSS. It just isn't a good idea.
JSWolf is offline   Reply With Quote
Advert
Old 05-12-2021, 01:38 PM   #6
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: 13,568
Karma: 65527815
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by The_book View Post
What I mean is, for example, when I convert a txt/markdown file to Epub by Calibre, class and css will be added by Calibre. Is there a opinion in Calibre that I can use to convert to a Epub without css and class?
Why bother converting then? The use of classes and stylesheets is what makes epub worthwhile.
DNSB is offline   Reply With Quote
Old 05-12-2021, 02:51 PM   #7
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,081
Karma: 12203626
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by The_book View Post
What I mean is, for example, when I convert a txt/markdown file to Epub by Calibre, class and css will be added by Calibre. Is there a opinion in Calibre that I can use to convert to a Epub without css and class?
If necessary you could open the epub in Calibre's editor and delete the css file. There might be class= stuff in the html but they won't have any effect since there isn't a css file.
hobnail is offline   Reply With Quote
Old 05-12-2021, 05:05 PM   #8
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: 13,568
Karma: 65527815
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by hobnail View Post
If necessary you could open the epub in Calibre's editor and delete the css file. There might be class= stuff in the html but they won't have any effect since there isn't a css file.
You do know that you can define classes in the html files? Not to mention some people's unnatural love for in-line styles? The code block is a sample from a Randy Penguin ebook's next read blurb.

Code:
  <style>
			@font-face {font-family: 'Shift Light'; font-style: normal; font-weight: bold; src: url('../Fonts/Shift-Bold.otf');}
			@font-face {font-family: 'Shift Light'; font-style: italic; font-weight: bold; src: url('../Fonts/Shift-BoldItalic.otf');}
			div {margin: 0; padding: 0; line-height: inherit; text-indent: 0;}
			h1 {font-size: 1.5em; text-align: center; margin: 0 0 1em 0; font-weight: bold; font-style: italic; line-height: inherit; text-indent: 0; font-family: 'Shift Light', Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;}
			p {text-align: center; text-indent: 0; margin: 1em 0 0 0; font-family: 'Shift Light', Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;}
			.center{text-align: center;}
			.x-small {font-weight: bold; font-size: 1em; margin: 0; padding: 0;}
			.image_h12{font-size: 1em; height: 12em; max-width: 100%;}
			a, a:link, a:visited, a:hover, a:active {font-weight: bold; font-size: 1.2em; color: #fa6400; text-decoration: underline;}
			.rule {font-size: 1em; margin: 1.2em 5% 0 5%; border-top: 1px solid #636363;}
		</style>

Last edited by DNSB; 05-12-2021 at 05:09 PM.
DNSB is offline   Reply With Quote
Old 05-12-2021, 05:11 PM   #9
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: 63,347
Karma: 103125649
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
What's the point of an ePub with no CSS?
JSWolf is offline   Reply With Quote
Old 05-12-2021, 05:14 PM   #10
retiredbiker
Addict
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 223
Karma: 232318
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Ubuntu, Jutoh,Kobo Forma
Saved searches - I actually use all these on some files:

<div.*?> replace with nothing
<span.*?> replace with nothing
<a.*?> replace with nothing
id=".*?" replace with nothing
<p.*?> replace with <p>

That gives you a pretty unstyled document in a few seconds.
retiredbiker is offline   Reply With Quote
Old 05-12-2021, 05:15 PM   #11
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,081
Karma: 12203626
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by DNSB View Post
You do know that you can define classes in the html files? Not to mention some people's unnatural love for in-line styles?
Urk, how could I forget those monstrosities?
hobnail is offline   Reply With Quote
Old 05-12-2021, 05:18 PM   #12
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: 63,347
Karma: 103125649
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by DNSB View Post
You do know that you can define classes in the html files? Not to mention some people's unnatural love for in-line styles? The code block is a sample from a Randy Penguin ebook's next read blurb.

Code:
  <style>
			@font-face {font-family: 'Shift Light'; font-style: normal; font-weight: bold; src: url('../Fonts/Shift-Bold.otf');}
			@font-face {font-family: 'Shift Light'; font-style: italic; font-weight: bold; src: url('../Fonts/Shift-BoldItalic.otf');}
			div {margin: 0; padding: 0; line-height: inherit; text-indent: 0;}
			h1 {font-size: 1.5em; text-align: center; margin: 0 0 1em 0; font-weight: bold; font-style: italic; line-height: inherit; text-indent: 0; font-family: 'Shift Light', Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;}
			p {text-align: center; text-indent: 0; margin: 1em 0 0 0; font-family: 'Shift Light', Palatino, 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, serif;}
			.center{text-align: center;}
			.x-small {font-weight: bold; font-size: 1em; margin: 0; padding: 0;}
			.image_h12{font-size: 1em; height: 12em; max-width: 100%;}
			a, a:link, a:visited, a:hover, a:active {font-weight: bold; font-size: 1.2em; color: #fa6400; text-decoration: underline;}
			.rule {font-size: 1em; margin: 1.2em 5% 0 5%; border-top: 1px solid #636363;}
		</style>
That mess is not a problem at all. I just delete the HTML file as I don't need or want it.
JSWolf is offline   Reply With Quote
Old 05-12-2021, 11:29 PM   #13
The_book
Connoisseur
The_book began at the beginning.
 
Posts: 85
Karma: 10
Join Date: Aug 2019
Device: none
Quote:
Originally Posted by DNSB View Post
Why bother converting then? The use of classes and stylesheets is what makes epub worthwhile.
Because I want the toc in the Epub.

pure txt do not have toc.

markdown support toc, but I haven't find a book reader support reading markdown files
The_book is offline   Reply With Quote
Old 05-13-2021, 12:34 AM   #14
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,081
Karma: 12203626
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by DNSB View Post
You do know that you can define classes in the html files? Not to mention some people's unnatural love for in-line styles?
There's also the thing where you can have css in the head. But the OP said he's converting from text/markdown with calibre. Does Calibre add in-line styles inside the resulting html/xhtml files?
hobnail is offline   Reply With Quote
Old 05-13-2021, 02:01 AM   #15
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 21,807
Karma: 37724701
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by The_book View Post
Because I want the toc in the Epub.

pure txt do not have toc.

markdown support toc, but I haven't find a book reader support reading markdown files
So why don't you want any CSS in the epub? Calibre won't convert a book without generating a basic CSS. But, you can remove or replace it. If you remove it, you are completely dependent on how what you are reading it with decides to style the tags.
davidfor 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
Converting ePub to Mobi reducing margin-top on CSS class battle_brother Conversion 4 06-20-2019 08:31 AM
Convert Several Html and Css files into one Epub File? MarjaE Editor 3 04-04-2017 03:20 PM
add css file to epub conversion VICTORSJG Calibre 0 09-21-2011 07:38 AM
epub.css file in OpenInkpot cloggy OpenInkpot 1 11-09-2010 07:28 PM
How can i convert HTML or txt file to EPUB file ? guguqiaqia ePub 7 05-28-2010 09:15 PM


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


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