Quote:
Originally Posted by joeindallas
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!
|
If that's your recipe, you haven't specified extra_css.
1) tell it to not use stylesheets:
Code:
no_stylesheets = True
2) You may need to strip inline styles
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;}
'''