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 11-28-2013, 04:42 AM   #1
sup
Enthusiast
sup began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Sep 2013
Device: Kindle Paperwhite (2012)
Convert external links to internal links

Sometimes, a page to be downloaded contains a link to another page that is to be downloaded in a single recipe. This is a good example: http://www.economist.com/news/world-...-politics-week (all the "see article" links point to another articles in the same edition that will be downloaded by the economist recipe).

I would like to convert them to point to the ebook file instead to the web. So that clicking on these links in a reader would just jump to the article in the reader and would not open the browser.

In a recipe, the list of all articles to be downloaded is created by parse_index. Linking to articles is possible (even if not trivial) as per this thread: http://www.mobileread.com/forums/sho...d.php?t=227912 .

But I am not sure how to acces the list returned by parse_index from postprocess_book (that is the function to do this stuff, right?). Also, should this be done at the recipe level at all or below it? Is there a reason why Calibre does not do this already? I think it should be implementable generically so that it would work for all recipes without any changes to the recipes - or not?
sup is offline   Reply With Quote
Old 11-28-2013, 05:54 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: 25,400
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's not implementable generically since there is no way to know the canonical url for an article. Typical URL schemes used by publishers include all sorts of cruft in the URL, therefore it is not possible to reliably identify what article a link points to.

A framework for this could be implemented, which delegates the mapping of links to article urls to the individual recipe sub-class, that is on my TODO list, along with a gazillion other things. Patches are welcome.
kovidgoyal is offline   Reply With Quote
Old 11-28-2013, 09:39 AM   #3
sup
Enthusiast
sup began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Sep 2013
Device: Kindle Paperwhite (2012)
Quote:
Originally Posted by kovidgoyal View Post
A framework for this could be implemented, which delegates the mapping of links to article urls to the individual recipe sub-class, that is on my TODO list, along with a gazillion other things. Patches are welcome.
I am afraid my Python abilities do not go that far, but good to know the state of things.
sup 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
Links to external PDFs Kmcd ePub 4 09-25-2013 05:56 PM
external links on Kindle superChuck Kindle Developer's Corner 5 11-23-2010 03:50 PM
Links to URLs work, internal links don't? NewDay ePub 36 10-27-2010 04:09 AM
Internal Links??? Guns4Hire PocketBook 11 04-18-2010 02:25 AM
HTML with external links posativ LRF 2 02-07-2010 07:27 AM


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


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