11-22-2011, 10:13 AM | #1 |
Junior Member
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 Code:
<p class="classname">text</p> Is there a different way to add classes to a txt? |
11-22-2011, 03:21 PM | #2 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
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.
|
Advert | |
|
11-22-2011, 03:48 PM | #3 |
Wizard
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. |
11-23-2011, 05:48 AM | #4 |
Guru
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... Code:
.poem {padding-left:10%; padding-right:10%; text-indent:0; text-align: left; font-style: italic;} Code:
<p class="poem">‘Twas brillig, and the slithy toves...</p> If I have another paragraph marked up as Code:
p(poem)=. 'Twas brillig, and the slithy toves... 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 06:07 AM. |
11-23-2011, 05:30 PM | #5 |
Junior Member
Posts: 2
Karma: 10
Join Date: Nov 2011
Device: iPod touch
|
|
Advert | |
|
|
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 07:32 PM |
TXT to EPUB - Freeze on 1% | ion475 | Conversion | 7 | 06-12-2011 01:39 AM |
TXT to ePub using Calibre | haino | ePub | 2 | 11-19-2010 05:37 PM |
Convert .TXT to .EPUB | Arfer | Calibre | 6 | 09-02-2010 10:41 AM |
Adding pictures to epub from a txt file | p3aul | Calibre | 3 | 04-16-2009 06:05 PM |