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 07-29-2024, 12:40 AM   #1
njpig
Zealot
njpig began at the beginning.
 
Posts: 104
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 07-29-2024, 01: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,564
Karma: 24495948
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 online now   Reply With Quote
Advert
Old 07-29-2024, 05:28 AM   #3
njpig
Zealot
njpig began at the beginning.
 
Posts: 104
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 03:50 AM
parse_index for a jpg link as an article url xiatian Recipes 2 12-01-2018 11:51 PM
E-mail an article LINK to Kindle? semicomatose Amazon Kindle 2 11-06-2015 03:10 PM
Article object in preprocess_html stuartweinstein Recipes 1 11-18-2010 12:53 PM
Article link - How to beat Kindle... kennyc News 6 09-08-2009 09:21 AM


All times are GMT -4. The time now is 05:49 AM.


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