Quote:
Originally Posted by kovidgoyal
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.