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 Yesterday, 11:40 PM   #1
njpig
Zealot
njpig began at the beginning.
 
Posts: 101
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
Get article link in preprocess_html()

Hi,

Is it possible to get the current article link in preprocess_html()?

Thanks, Fei.
njpig is offline   Reply With Quote
Old Today, 12:21 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: 44,159
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, use preprocess_raw_html for that. You can always convert it to soup with self.index_to_soup(raw). Just remember to return str(soup) at the end.
kovidgoyal is offline   Reply With Quote
Advert
Old Today, 04:28 AM   #3
njpig
Zealot
njpig began at the beginning.
 
Posts: 101
Karma: 10
Join Date: Sep 2020
Device: kindle paperwhite3/Oasis2
Thanks!

BTW, my recipe failed with reprocess_html replaced by preprocess_raw_html() until I realized preprocess_html was called after keep_only_tags and remove_tags while preprocess_raw_html was not.
njpig is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Article link is hyperlinked into the text of every article of an RSS feed.. unkn0wn Recipes 3 09-10-2021 02:50 AM
parse_index for a jpg link as an article url xiatian Recipes 2 12-01-2018 10:51 PM
E-mail an article LINK to Kindle? semicomatose Amazon Kindle 2 11-06-2015 02:10 PM
Article object in preprocess_html stuartweinstein Recipes 1 11-18-2010 11:53 AM
Article link - How to beat Kindle... kennyc News 6 09-08-2009 08:21 AM


All times are GMT -4. The time now is 08:22 AM.


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