09-21-2009, 12:46 PM | #1 |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
[Discussion moved into it's own thread from here]
I've been thinking about exposing the internals of Sigil to an embedded version of Python (or Lua, or C# through embedded Mono). What do others think of this? Last edited by Valloric; 09-24-2009 at 01:20 PM. |
09-22-2009, 09:43 AM | #2 | |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Possible scripting engine for Sigil
Quote:
http://www.acetext.com/ The operation is straight foward and simple and requires no knowledge of any programming language. The price is reasonable and they provide full interface data. A fullup trial version is availabe with full documentation. By following instructions any text string can be inserted at the caret or before/after any highlighted text. AceText works with SIGIL as it stands (by naming SIGIL in the Peferences) and changing the HTML becomes simplicity itself. All text clips can be saved in named Collections to be used any time. A fullup CSS can be saved and inserted into the HTML with a simple placement of the caret in the editor and a double-click on the named Clip. Preformatted tags can be saved and inserted as desired. Repetitive programming becomes a simple PLACE CARET - DOUBLE CLICK. Sharing of Clip Collections is simple. It would be nice if the interface were explicit to preclude any problems with future changes to SIGIL. DISCLAIMER I am in no way connected to JGSoft other than as a very satisfied user of their tools for a very long time. Being sometimes very slow, I especially appreciate their excellent documentation. Last edited by DaleDe; 09-22-2009 at 11:13 AM. Reason: correct formatting |
|
Advert | |
|
09-22-2009, 10:10 AM | #3 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
That application can be used to insert snippets, but an embedded scripting language could offer much more. I'm asking how do people feel about that feature, and what language would they like to see embedded. |
|
09-22-2009, 07:16 PM | #4 | |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Quote:
Each book is an individual work and must be approached as such. Scripting is for handling multiple books in exactly the same manner. It seems to me that this is the provence of SIGIL itself. A scripting language seems to be for making changes to the SIGIL output. Which is fine. However, if SIGIL produces a clean solid HTML file, with the ability to insert a TOC and other desired links, e.g. a linked LIST of ILLUSTRATIONS and will let me go in and format the book as I see fit, I will be as happy as a Blujay in a corn patch. I will then bless thee and thine to the seventh generation and shout thy praise from the roof tops. Thanks for all your work. You are totally dedicated. Charlie |
|
09-22-2009, 07:31 PM | #5 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
It's not something that would be implemented any time soon, but it's interesting. Of course, if the community expresses a deep desire for this kind of functionality, that would give it more priority. |
|
Advert | |
|
09-22-2009, 08:23 PM | #6 |
creator of calibre
Posts: 44,565
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Shouldn't you more or less get that for free with QtScript?
|
09-22-2009, 08:45 PM | #7 |
Banned
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
|
I'd like to see you do it NoteTab style. Check out the Clip language -- and the embedded clip window that lets you write scripted macros.
I don't expect that you'll recreate that language, just look at how it works -- it's really functional, with libraries of macros displayed. It can pretty much do anything at all. I wrote a full ebook editing and file-management suite in it. I'd personally prefer to avoid a scripting language that looks like C code. It should look like BASIC actually. Something slightly more abstracted means that even doofii like me can code complex macros. m a r |
09-22-2009, 10:26 PM | #8 |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
QtScript is based on JavaScript. I hate JavaScript.
I'll take a look at it. |
09-23-2009, 08:40 AM | #9 | |
Connoisseur
Posts: 95
Karma: 72819
Join Date: Oct 2006
Location: Drenthe, The Netherlands
Device: Cybook Gen3 (cracked screen)/Bebook/Nokia E60/Nokia 5800/Kobo Aura HD
|
Quote:
It has been done a zillion times before, but it is the first method which springs to mind when I think about how to automate the proces of inserting "drop capitals" |
|
09-23-2009, 03:24 PM | #10 | |
Addict
Posts: 257
Karma: 960
Join Date: Dec 2006
Device: REB1200; REB2150; Sony 500/350; EZReader; IREX DR800SG; Nook/Color
|
Quote:
Basic sounds good, but it's just more typing and non case sensitive - dubious advantage. If I had to learn new scripting or scripting like language I would vote for ruby. Had a very tough time learning lua. |
|
09-23-2009, 08:47 PM | #11 | |
Banned
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
|
Quote:
When I said BASIC, I basically (hah!) meant that it should be relatively easy to learn and simple in syntax. The example I gave with NoteTab falls into that paradigm. It can do amazing stuff, but it is really easy to learn. Over time, it added more than just text manipulation -- it moved into regex, file management, disk-access, web-capability, and more. The point is to make it accessible to non-programmers. Folks editing and formatting their favorite books are not likely to be conversant with the ins and outs of proper programming. But if you can come at it from a simpler format, you'll get a lot more people contributing useful macros. And you can always add complexity. I'm not a complete idiot, and I've programmed macros for years -- but when I start seeing massively indented bracket outlines, I just turn right off, lose enthusiasm. When I switched to Linux, I looked for a text editor that was programmable, comparable to NoteTab. I found Nedit, and a few others -- but they all required knowledge of C, or C structuring, familiarity with low-level use of environment variables, sed, etc. They were programmer's editors (which is natural, considering the nature of Linux.) I still keep a Virtual Machine of Win2K in order to run the latest NoteTab because I can't find a replacement (what, 8 or 9 years later...) A macro in a text (or HTML, or writer's) editor is a list of instructions, manipulating (in this case) text and variables -- do this, then this, add it to the other thing, and put it over here. I feel that it should be as straightforward and simple as possible, while still retaining capacity to do anything at all that the host editor can do. Add hooks to other scripting languages if you want, but keep the native language simple. BASIC is a good example of this sort of thinking (and Clip, from NoteTab) -- javascript is not, nor C*. Perhaps AppleScript, too, is a good example. What I remember of it was some sort of 'natural' language syntax. I thought it was a little loose, but better too loose than too strict. Book editing is much closer to artistry (writing) than programming (as it is usually performed.) Make tools that enable the likely sort of people that will be using the editor. $.02 m a r Last edited by rogue_ronin; 09-23-2009 at 08:52 PM. Reason: Added an example. |
|
09-24-2009, 03:40 AM | #12 | ||
Connoisseur
Posts: 95
Karma: 72819
Join Date: Oct 2006
Location: Drenthe, The Netherlands
Device: Cybook Gen3 (cracked screen)/Bebook/Nokia E60/Nokia 5800/Kobo Aura HD
|
Quote:
Quote:
Allthough... I guess that most actions you want to automate have something to do with search&replace. Next to that, you would like some knowledge of where you are in a document. The typical topography of a book-like document is something like "book - chapter - paragraph - sentence - word - character". Being able to search&replace text on a specific character or specific word in a specific sentence from a specific paragraph in a specific chapter could be really awesome. And relatively easy to build into Sigil... What's more, it is something a book writer/maker would know how to use... |
||
09-24-2009, 05:52 AM | #13 |
Fanatic
Posts: 574
Karma: 138556
Join Date: May 2006
Device: PRS505
|
I'd vote for python, since it appear that we have many python expert around here (Kovid, Igor, user_none, etc). Also it would facilitate reusing code from Calibre in Sigil (I think).
Last edited by Dave Berk; 09-24-2009 at 05:59 AM. |
09-24-2009, 10:55 AM | #14 | |
Addict
Posts: 257
Karma: 960
Join Date: Dec 2006
Device: REB1200; REB2150; Sony 500/350; EZReader; IREX DR800SG; Nook/Color
|
Quote:
I like notepad++ and ultraedit. I would use notepad++ since it's free and has good plugins, but I am using ultraedit since on top of macro language (which both have) it has scripting with a normal language. I think Microsoft Office can be commanded for at least this accomplishment of including nice scripting capability. Hate their code storage paradigm though. |
|
09-24-2009, 01:29 PM | #15 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
So Python would currently be the front-runner. There are countless books on it and everyone and their grandmother seems to know it (or are learning it). |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Scripting with epub-meta | averyml | Calibre | 20 | 11-17-2016 11:13 AM |
Entourage Edge and the Android Scripting Environment | paulckennedy | enTourage eDGe | 9 | 07-12-2011 01:32 PM |
iLiad Lua: scripting for Iliad | hansel | iRex Developer's Corner | 3 | 12-14-2008 07:51 PM |
Simple browser scripting for content? | mphuie | Workshop | 2 | 01-29-2008 09:38 PM |
Any NetNewsWire Scripting Pros out there? | adinb | Sony Reader | 0 | 02-25-2007 02:44 AM |