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 11-22-2011, 11:13 AM   #1
Nareshkendel
Junior Member
Nareshkendel began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2011
Device: iPod touch
txt to Epub - adding classes with textile

Hi. Sorry if this has been discussed before, I couldn't find anything in the forums about it.

I'm converting a txt formated in textile to epub. I want some paragraphs to have an specific class so I can later add some css formating. According to http://www.textism.com/tools/textile/, to add a class I just have to write:
Code:
p(classname). text
and it should become this in html:
Code:
<p class="classname">text</p>
But calibre completly ignores this, it ends up with the same standard calibre# class as all paragraphs in the book.

Is there a different way to add classes to a txt?
Nareshkendel is offline   Reply With Quote
Old 11-22-2011, 04:21 PM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,473
Karma: 1053245
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Calibre normalizes classes as part of the conversion process. There is no way time retain custom classes with any input source.
user_none is offline   Reply With Quote
Old 11-22-2011, 04:48 PM   #3
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Actually there is. But you can't do it that way, and you can't do it with any tag (definitely not with <p>). With markdown (and probably textile) you can insert <span class="xyz">some text</span>.

Then in Calibre's extra css under look and feel you put this:
.xyz {whatever styles;}

Looks like with Textile you need to put a space in front of any lines that use actual html - I think that might disable textile processing for those lines - seems like Markdown may be a bit ahead of Textile in this area.
ldolse is offline   Reply With Quote
Old 11-23-2011, 06:48 AM   #4
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
If I have a paragraph marked up as
Code:
p(poem). 'Twas brillig, and the slithy toves...
and in extra CSS box have

Code:
.poem {padding-left:10%; padding-right:10%; text-indent:0; text-align: left; font-style: italic;}
Then the resulting epub html DOES keep the 'poem' classname

Code:
<p class="poem">‘Twas brillig, and the slithy toves...</p>
EDIT:
If I have another paragraph marked up as
Code:
p(poem)=. 'Twas brillig, and the slithy toves...
(Note the = center align)

Calibre also creates a .poem1 class with the same css as poem but also including the text-align:center; tags.

Last edited by Perkin; 11-23-2011 at 07:07 AM.
Perkin is offline   Reply With Quote
Old 11-23-2011, 06:30 PM   #5
Nareshkendel
Junior Member
Nareshkendel began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2011
Device: iPod touch
Quote:
Originally Posted by Perkin View Post
If I have a paragraph marked up as
Code:
p(poem). 'Twas brillig, and the slithy toves...
[...]
This worked great, thanks
Nareshkendel 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, During ePub to ePub Conversion does Calibre changes existing CSS classes? JSWolf Conversion 7 08-06-2011 08:32 PM
TXT to EPUB - Freeze on 1% ion475 Conversion 7 06-12-2011 02:39 AM
TXT to ePub using Calibre haino ePub 2 11-19-2010 06:37 PM
Convert .TXT to .EPUB Arfer Calibre 6 09-02-2010 11:41 AM
Adding pictures to epub from a txt file p3aul Calibre 3 04-16-2009 07:05 PM


All times are GMT -4. The time now is 02:39 PM.


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