View Single Post
Old 08-09-2017, 08:53 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,842
Karma: 6120478
Join Date: Nov 2009
Device: many
It is not easy. Renaming an xhtml file to some other extension involves walking the complete set of files and fixing all internal links, all toc.ncx entries, opf manifest entries. This ability is built into Sigil itself. So if you want to rename files, even multiple files, you should do this inside of Sigil before invoking an edit plugin.

FYI, The Sigil plugin system uses a copy on change approach and so you are not working with files internal to Sigil, just copies. This is to prevent a plugin from crashing Sigil. Instead the modified files are passed back to Sigil who then checks them and if okay merges the changed files in.

Please see the Plugin documentation and the sample plugin for use of the iterators for each file types and how manifest ids are used to access files.

Ask if you have questions.
KevinH is online now   Reply With Quote