View Single Post
Old 12-23-2025, 01:12 PM   #11
Trester99
Member
Trester99 began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jun 2024
Device: Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
Not sure what AI you were using but after getting the file name, this is literally 5 lines of code.

Code:
from calibre.ebooks.oeb.polish import get_container
from calibre.ebooks.oeb.polish.replace import remove_links_to
c = get_container(path, tweak_mode=True)
def predicate(name, href, fragment=None): return name == fname_to_remove
remove_links_to(c, 
c.remove_item(name_to_remove)
c.commit(path_to_save_to)
Thanks Kovid!

Up until recently, I had been using Gemini Pro and ChatGPT Pro interchangeably. Since Gemini upgraded to 3.0, I have switched to Gemini. Unfortunately, neither Gemini or ChatGPT is ever successful converting a script file to a plugin. For all of my previous projects I have relied on script files ran thru the Calibre Debug program, which works fine. For this program, I tried Grok for the first time and they were able to create a Plugin in about 10 minutes.
Trester99 is offline   Reply With Quote