View Single Post
Old 08-23-2010, 11:43 AM   #2
cisaak
Member
cisaak began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Aug 2010
Device: Kindle DX
Quote:
Originally Posted by GRiker View Post
0.6.37 introduces the ability for recipes to specify a masthead image to be used when generating a periodical for the Kindle.

The masthead image is displayed in three locations on the Kindle:
  • From the Home page, toggling right while the periodical is highlighted
  • At the top of the Section List
  • At the top of the first article in the first section

You have two options for generating a masthead image:
  • Add a 'masthead_url' property to your recipe, pointing to an online image resource to use as the masthead:
    Code:
        masthead_url = 'http://graphics8.nytimes.com/images/misc/nytlogo379x64.gif'
    To identify a suitable masthead image, go to the site your recipe downloads from and look for a logo with proportions approximately 6:1, e.g., 600 wide x 100 tall. The exact dimensions are not critical, only the proportions. You may need to experiment to find one you like. Tested formats include GIF, JPG, BMP, and PNG.
  • Add a get_masthead_title() method, specifying a text string to be rendered as the masthead image:
    Code:
        def get_masthead_title(self):
            return 'My Custom Masthead Title'
    If 'masthead_url' is not defined in your recipe, or it fails to load, then the BasicNewsRecipe() will render the text returned by get_masthead_title() as the masthead. If you don't have this method in your recipe, the friendly name of the recipe will be used.

By default, existing recipes will use their name property as the text for the customized masthead.

G
I've used get_masthead_title to add a text masthead but the masthead truncates when viewed on my Kindle. I think I should use css to reduce the masthead's font size but do not know how. Any suggestions?
cisaak is offline   Reply With Quote