Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 06-24-2013, 12:51 PM   #1
ehead
Member
ehead began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2013
Device: Kobo Aura HD
Add cover and "shelves" in recipe?

Hi,

I'm trying to figure out how to add a cover to a recipe? I have a jpg on my disk I would like to use as the cover. I saw a function mentioned in the API called default_cover() I think, but am unsure of the syntax. It looks like this function is defined in most of the recipes I've seen.

Also... is it possible to add the epub resulting from a recipe to some shelves automatically?

Thanks for any help.
ehead is offline   Reply With Quote
Old 06-24-2013, 01:51 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,773
Karma: 75003038
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Well, not sure about qiestion 1, but I just tried an experiment here on the shelving.

Not being quite sure what type of shelving you want, I came up with an approach that would assign a recipe to a shelf based on the recipe name.

Add a custom column to calibre as follows
Code:
Lookup name: newsshelf
Column Heading: News Shelf
Column Type: Column built from other columns
Template: {:'strcmp(list_intersection(field('tags'), 'News', ','),'News','',list_item(field('title'),0,'['),'')'}
What the column is doing is looking for entries with the News tag, and then returning the value of title excluding the date info. On the news articles I tesetd, their title was always of the form Recipe Name [date run].

Then, just add the value #newsshelf to the list of column in either the Kobo Touch or Kobo Extended driver (depending on which one you are using to send data to the Kobo).
PeterT is offline   Reply With Quote
Advert
Old 06-24-2013, 02:23 PM   #3
ehead
Member
ehead began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2013
Device: Kobo Aura HD
Come to think of it, the second question was kind of confusing because custom "shelves" are not a part of stock Calibre. I created a new shelf field and column that would sync to the shelves on my Kobo.

I think this was the original article:
https://www.mobileread.com/forums/sho...d.php?t=193184
ehead is offline   Reply With Quote
Old 06-24-2013, 03:26 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,565
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Simply set

cover_url = 'file:///whatever'

in your recipe.
kovidgoyal is offline   Reply With Quote
Old 06-24-2013, 05:43 PM   #5
ehead
Member
ehead began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2013
Device: Kobo Aura HD
Awesome. Thanks!

Do you know if there is a way to have the resulting book be added to my custom "news" shelf?
ehead is offline   Reply With Quote
Advert
Old 06-24-2013, 06:24 PM   #6
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,773
Karma: 75003038
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Does my post above help?

If you want it to go to a shelf called 'News' then
Code:
{:'strcmp(list_intersection(field('tags'), 'News', ','),'News','','News','')'}
PeterT is offline   Reply With Quote
Old 06-28-2013, 10:27 PM   #7
ehead
Member
ehead began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2013
Device: Kobo Aura HD
Hey PeterT, thanks for the help.

I'm not sure where exactly I should put the above code.

I'm in the "Add custom New Source" advanced page. When I try and add the above it says something about the there being an error on line #55.
ehead is offline   Reply With Quote
Old 06-28-2013, 11:32 PM   #8
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,773
Karma: 75003038
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Nooooo... this has nothing to do with news sources; rather it has to with general calibre customization, and also with the Kobo (or Kobo Extended) driver configuration.

What you're doing is to initially add a custom column to calibre.

Go to Preferences | Change calibre behavior | Interface | Add your own column then Add custom column (either the button across the bottom or the green + sign).

Add a custom column to calibre as follows
Code:
Lookup name: newsshelf
Column Heading: News Shelf
Column Type: Column built from other columns
Template: {:'strcmp(list_intersection(field('tags'), 'News', ','),'News','','News','')'}
What the column is doing is looking for entries with the tag News and then returning the value News.

If you want to use a different shelf name, just change the third occurrence of News (the one in red).

Once you've added the column you will have to restart calibre.

Then, just add the value #newsshelf to the list of column in either the Kobo Touch or Kobo Extended driver (depending on which one you are using to send data to the Kobo).

For more info on the Kobo Shelving options see Quick Guide to Shelf Management with calibre 0.9.1 & above (Touch / Glo / Mini /Aura).
PeterT is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A PY script to make "shelves" from folders? Ken Maltby Kobo Reader 13 05-20-2013 02:09 PM
Recipe for EPUB subscribers of "Tagesspiegel" and "Handelsblatt"? F.W. Recipes 0 05-14-2013 12:16 PM
New recipe for "Süddeutsche Zeitung" using "E-Paper mobile" subscription Ernst Recipes 3 02-16-2013 08:37 AM
Recipe for "Galicia Confidencial" and "De L a V" roebek Recipes 1 07-19-2011 10:17 AM
My DIY cover for the Kobo - the "KoBook" (or "BooKobo") Beorn Kobo Reader 4 07-12-2010 08:06 PM


All times are GMT -4. The time now is 09:58 PM.


MobileRead.com is a privately owned, operated and funded community.