View Single Post
Old 11-06-2011, 07:39 AM   #1
mattst
Enthusiast
mattst began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Nov 2011
Device: Kindle
BBC Recipe conversion_options explaination needed.

Currently the various BBC News recipes either do not work at all or do not work very well (including the one posted on 07-23-2010 by Starson17 on this board). Part of the reason is changes to the site and partly that the HTML used by the news site developers often seems to have minor errors in, Eg. a double space used in a tag, a trailing space at the end of it, a missing '-' in a tag and so on.

I am in the process of completely re-writing the recipe, including using regular expressions for all the elements in the keep_only and remove tags lists in an effort to make the recipe robust.

Being a recipe noob, though with a strong programming background, there is one aspect of the existing BBC News recipes which I do not understand.

Code:
Eg. From the Darko Miletic / Starson17 recipe (link below):
https://www.mobileread.com/forums/showpost.php?p=1022483&postcount=14

conversion_options = {
'comments'         : description,
'tags'             : category,
'language'         : language,
'publisher'        : publisher,
'linearize_tables' : True }
Of course I've read the help on it here - http://manual.calibre-ebook.com/news_recipe.html - but frankly that has not helped me understand what is happening with the conversions made in the code above. Can someone explain to me what the various conversion_options above are actually doing please?

Many thanks.
mattst is offline   Reply With Quote