![]() |
#1 |
Enthusiast
![]() Posts: 30
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
Help with text justification
OK, I've tried to go through all the tutorials and examples, but i can't seem to get the text in a simple recipe I've cobbled together (Dallas Morning News sports feeds) to be left justified. I've tried to use the USA Today recipe as an example, but no matter what i try - all the text in the articles is center justified. If I examine the output of the command line interface, i see:
'change_justification': 'original', ... 'extra_css': None, even though I've specified extra CSS. Any ideas? The recipe (with the unworking extra CSS stripped out): import re from calibre.web.feeds.recipes import BasicNewsRecipe class AdvancedUserRecipe1295487944(BasicNewsRecipe): title = u'DMN Team RSS Sports Feeds' oldest_article = 7 max_articles_per_feed = 100 remove_tags = [dict(name='div', attrs={'class':'categoryGroup'})] remove_tags.append(dict(name = 'div', attrs = {'class': 'archivesGroup'})) feeds = [(u'Rangers RSS', u'http://rangersblog.dallasnews.com/index.xml'), (u'Mavericks RSS', u'http://mavsblog.dallasnews.com/index.xml'), (u'Cowboys RSS', u'http://cowboysblog.dallasnews.com/index.xml')] Thanks for any help! |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
1) tell it to not use stylesheets: Code:
no_stylesheets = True 3) Add your extra_css, here's a common one: Code:
extra_css = ''' h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} p{font-family:Arial,Helvetica,sans-serif;font-size:small;} body{font-family:Helvetica,Arial,sans-serif;font-size:small;} ''' |
|
![]() |
![]() |
![]() |
#3 |
Enthusiast
![]() Posts: 30
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
I deleted my lines for "no_stylesheets" and "extra_css" since they weren't working (and I was a little afraid that I was really just being stupid!)
Your code worked! At least it changed the fonts and sizes, so I was able to add the left justification and it works. The weird thing: I think my attempts all had extra_css = ' blah, blah' in single quotes. It looked to me like your example had two double-quotes on each side, but when I cut-and-pasted into textpad and saved as *.recipe - it saved it as 3 single-qotes on each side. I'm really confused, but it works - thank you very much! Joe Last edited by joeindallas; 01-26-2011 at 06:28 PM. Reason: spelling |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Text Justification | ramjet1953 | Sigil | 1 | 11-07-2010 09:53 PM |
Text Justification | GSteer | Kobo Reader | 4 | 05-03-2010 12:55 AM |
LIT to EPUB Text Justification | Solicitous | Calibre | 5 | 11-17-2009 06:31 AM |
Help with text justification | jament | Calibre | 4 | 11-10-2009 05:27 PM |
Kindle 2 Text Justification | leonardfrye | Amazon Kindle | 3 | 02-16-2009 02:57 PM |