View Single Post
Old 06-03-2011, 03:12 PM   #17
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Valloric View Post
Who says I won't implement a scripting option? There was a thread a while back about adding a scripting language to Sigil, and I agreed it was a good idea. I wanted to bring in Python. But other needs came first, and this feature was postponed.

It's still very much an idea I look forward to implementing. My current idea for Sigil's future is to get it to an "IDE for epub" state; power users need the power, but you still need to keep things simple for the average user.

I still think about this feature every now and then. The scripting language will probably be pure JavaScript since Nokia is pushing it hard as "the" scripting language for Qt apps. So there's support for it directly in the framework.

Frankly, it shouldn't be too hard to leverage the Qt JS support and build a scripting framework on top of it in Sigil. Pretty much all I'd need to do is provide an API for accessing the text of all the content files in the epub, and then let people use raw JS functionality on top of it for whatever work they need done. With raw access to the content of all the files, you can get a lot done. A nice UI for this will be most of the work; a new "Scripts" side pane (kind of like a Book Browser, but for scripts) and buttons/menus/actions for running the code. Editing the scripts would just be new tabs in the main pane.

Further on, I'd need to add API's for file creation/renaming/moving etc within the EPUB archive, but that wouldn't be too hard.

Since JavaScriptCore is the JS engine used in Qt and JSC use PCRE internally for regex functionality, this would indirectly bring an oft-requested feature to Sigil.

All of this shouldn't take more than a week to add to Sigil, but I can't dedicate that time to this feature right now. There are more important issues in the queue, not the least of which is getting 0.4.0 stable. But if someone else expressed a desire to work on this feature, well... they'd have my full support.

I don't have the Fu to make it happen--but I'd contribute $$$ to make it happen. V, you kow how to find me if that possibility is open.

Hitch
Hitch is offline   Reply With Quote