Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2014, 04:04 AM   #1
EnergyLens
Hack
EnergyLens began at the beginning.
 
Posts: 34
Karma: 12
Join Date: Dec 2009
Device: Kobo Aura HD, Kindle Paperwhite
Modify TOC *after* all feeds downloaded

Sorry if this is a bother. I've searched every way I know how to see if this or something similar has been covered before...

I am trying to figure out how to modify the table of contents after all feeds have downloaded. The title used in the TOC generated by news recipes is taken from the tuple (title,url) that is returned in feeds from parse_index, but sometimes useful title information is available only *after* an article has been processed.

I can use populate_article_metadata to access information from within the body of an article to modify title, date & etc. but this unfortunately has no effect for the TOC that is ultimately generated.

Is it possible to modify the feedobject at any point after parse_index, and if so, how?

Thanks you!
EnergyLens is offline   Reply With Quote
Old 10-18-2014, 04:20 AM   #2
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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Probably by overiding feed2index in your sub class, if you are referring to the html table of contents. And create_opf() if you are referring to the ncx ToC. Although, IIRC the NCX aToC should already be using article.title, which will have been updated by populate_article_metadata.
kovidgoyal is offline   Reply With Quote
Old 10-18-2014, 02:29 PM   #3
EnergyLens
Hack
EnergyLens began at the beginning.
 
Posts: 34
Karma: 12
Join Date: Dec 2009
Device: Kobo Aura HD, Kindle Paperwhite
Yes, populate_article_metadata works as you describe. I was having problems extracting data from html I generated and inserted in soup replacing elements without rebuilding the tree, and that led me to looking for more direct means.

Thanks for the incredibly quick reply.
EnergyLens is offline   Reply With Quote
Reply

Tags
feedobject, toc


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre : Recipe Wissen.de : modify TOC ? xav Recipes 0 09-07-2014 08:00 AM
TOC not hooked up properly in downloaded/converted news RobFreundlich Recipes 5 06-11-2013 01:12 PM
Conversions: How to Modify Paragraphs Without Affecting the TOC? Skydog Conversion 0 01-22-2013 02:38 AM
Retrieved news feeds can't be downloaded to Stanza on iPhone bthoven Calibre 0 10-27-2009 12:08 AM
Using the Calibre downloaded RSS/news feeds via Mobi2IMP and Impserve nrapallo Fictionwise eBookwise 0 03-23-2009 11:03 PM


All times are GMT -4. The time now is 06:54 AM.


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