|
|
#1 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2018
Device: none
|
Use CSS sheet in conversion
Hi,
I have some raw text files that I want to convert to epub (they will be easier to read on my tablet). Is there a way to use a sspecific CSS file in the conversion, instead of what seemed to be hardcoded calibre* classes? I don't want to search and replace the generated files to change the styles afterwards, if I can help it. |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look in the look & feel section of th econversion dialog
|
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Quote:
If you are starting from raw text files then you will not have any pre-existing classes so any classes generated will be as a result of any conversion options you specify. |
|
|
|
|
|
|
#4 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2018
Device: none
|
Thank you itimpi, it makes (a little) more sense now.
But I am still confused about the whole process: - in the look&feel section, it is said that you can add a CSS path. But there is now button to add it. how can you do that? - I tried to add some CSS instructions and I see them added to the calibre* classes in the output. But what if simply want to use my specific classes, that I have in a CSS stylesheet file, or even more don't use classes at all, and just use a stylesheet that sets values for p, h1, h2, etc. Can I do this from a raw text file as input, or do I have to first convert to XHTML? |
|
|
|
|
|
#5 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 454
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
Since you're going from raw text, a conversion has no real way of knowing where to apply your css, no matter what you put in...it has no coding to start from.
In such cases, I have a very simple css in a text file that contains what I like for reading: indent, noindent, chaptertitle, quotations, verse, center, right, and that's about it. I convert the text to epub, then in the editor import my css file. Then I use search and replace as needed to change 'calibren' classes to my own. For a simple book like a novel this usually only takes a few minutes. If you have a lot of fancy stuff you want to pretty up, well, that can take a while. I know you don't want to do that, but I don't see any other way. Last edited by retiredbiker; 11-28-2018 at 12:20 PM. |
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,702
Karma: 79983758
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
calibre conversions will always use it's own class names.
For an idea on the extra cxs see https://manual.calibre-ebook.com/con...html#extra-css |
|
|
|
|
|
#7 | |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2018
Device: none
|
Quote:
|
|
|
|
|
|
|
#8 | |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Nov 2018
Device: none
|
Quote:
|
|
|
|
|
|
|
#9 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
copy paste will always work. An absolute path should work, if you get it right
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to remove CSS style sheet from epub files | Achromatic | Calibre | 2 | 01-01-2016 11:15 AM |
| css code ignored in conversion | barrytatt | Conversion | 2 | 12-26-2014 07:41 AM |
| CSS conversion from a plugin | jgoguen | Development | 1 | 02-13-2013 12:11 AM |
| An example file of your CSS style sheet | roger64 | Writer2ePub | 6 | 04-11-2012 03:59 AM |
| Additional CSS for conversion | LARdT | Calibre | 6 | 02-18-2010 08:52 PM |