View Single Post
Old 01-26-2011, 04:53 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by joeindallas View Post
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;}
		'''
Starson17 is offline   Reply With Quote