Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2025, 05:04 PM   #1
scampos
Member
scampos began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2007
Location: Brasil
Device: Sony Reader
Removing links from downloaded news

Hi all,

I often download news using Calibre, but I am old fashioned and want to read the text sequentially, and therefore do not like links in the downloaded document. Actually I sometimes select a link and then uneeded things happen, such as trying to visit a web site or something. Since I use my Kindle in airplane mode it is rather annoying.

The question is, how can I remove links from a downloaded news file ? Or better yet, how can I make sure that no link is generated ?

Thanks in advance,
Sergio.
scampos is offline   Reply With Quote
Old 03-14-2025, 10:37 PM   #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: 45,145
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can edit the news recipe and add

remove_attributes = ['href']

to it.
kovidgoyal is offline   Reply With Quote
Advert
Old 03-15-2025, 08:27 PM   #3
scampos
Member
scampos began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2007
Location: Brasil
Device: Sony Reader
Thanks, but how can I edit the news recipe ? How do I get it ? When I select Fetch news and click download I see no option for editing the recipe or downloading it.
scampos is offline   Reply With Quote
Old 03-15-2025, 10:47 PM   #4
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: 45,145
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Right click the fetch news button and choose add or edit custom news source
kovidgoyal is offline   Reply With Quote
Old 03-16-2025, 05:57 AM   #5
scampos
Member
scampos began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2007
Location: Brasil
Device: Sony Reader
Thank you. I did get that far, but I forgot to mention that I don't want to start from scratch. i use mostly the The Economist recipe. How can I get so that I can modify it ?
scampos is offline   Reply With Quote
Advert
Old 03-16-2025, 07:14 AM   #6
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: 45,145
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Click the customize builtin recipe button to edit an existing builting recipe
kovidgoyal is offline   Reply With Quote
Old 03-18-2025, 04:48 PM   #7
scampos
Member
scampos began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2007
Location: Brasil
Device: Sony Reader
Thanks. I did find how to download the recipe and change it.

Unfortunately adding remove_attributes = ["href"] to the recipe did not work.

I still get links. I guess because this has been downloaded as a web page, the links point to the original pages in the web site.

I tried to convert the file. I went into the Look & feel options, Transform HTML tab, and added a rule that if a tag is [href] I remove it, but that did not work either. Is there a way of converting the file to remove the links ?
scampos is offline   Reply With Quote
Old 03-18-2025, 09:41 PM   #8
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: 45,145
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
remove_attributes = ['href'] works fine, as does using transform HTML to remove the href attribute, though running an extra convert to use the latter will destroy amazon specific periodical formatting.
kovidgoyal is offline   Reply With Quote
Old 03-19-2025, 07:46 AM   #9
scampos
Member
scampos began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2007
Location: Brasil
Device: Sony Reader
I see. Perhaps you can help me find what I did wrong. I am attaching the .recipe file below. In this week's The Economist on the very first paragraph of the weekly news there a link under the word Syria that was not removed. Perhaps I modified the recipe wrong ?

Using conversion, I don't mind losing the specific formatting, I am already converting it for another reason. To remove the href in the conversion should I type the tag name as href or 'href' or [href] or ['href'] or something else ?

Thanks again.
Attached Files
File Type: recipe economist.recipe (29.6 KB, 24 views)
scampos is offline   Reply With Quote
Old 03-19-2025, 10:45 AM   #10
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: 45,145
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
In your recipe, locate the existing remove_attributes and add href to it.
kovidgoyal is offline   Reply With Quote
Old 03-20-2025, 12:21 PM   #11
scampos
Member
scampos began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jul 2007
Location: Brasil
Device: Sony Reader
Ah, ok, so it was not add a remove_attributes line, but to add 'href' to an existing remove_attributes line, I get it now.

Thanks Kovid, it worked.
scampos is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing links from articles brennandai Recipes 4 08-03-2023 02:56 PM
Convert links to text in downloaded news jma1 Recipes 8 01-06-2019 10:27 PM
removing links from text . rolgiati Sigil 14 01-18-2015 07:09 PM
Glo removing non-downloaded kepubs? dakini Kobo Reader 7 10-10-2014 06:48 AM
Add only news tag to downloaded news? eric11210 Calibre 2 08-06-2010 05:51 AM


All times are GMT -4. The time now is 09:15 AM.


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