10-10-2013, 02:27 PM | #31 | |
Grand Sorcerer
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
Quote:
Replacing Tweak Book should ultimately yield an editor that can do what Sigil can do now, in a similar way, but without ever leaving Calibre. (Or, of course, do it while used stand-alone by starting its own executable outside of Calibre.) |
|
10-10-2013, 09:06 PM | #32 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Syncing the bookview and codeview was a source of endless grief for user_none if memory serves primarily because there is not a one-one correspondence between the two. So I understand your lack of interest in direct editing.
|
Advert | |
|
10-10-2013, 09:57 PM | #33 | |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
A Solid (view) Synch is good . Bi-directional would be outstanding. |
|
10-10-2013, 10:28 PM | #34 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@theducks: Marking split points should be doable in the preview panel, it will work just like marking table of contents locations works in the current edit ToC tool. Its the editing of content directly in a webview that I dont want to support.
|
10-12-2013, 09:26 PM | #35 | |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Quote:
|
|
Advert | |
|
10-12-2013, 09:44 PM | #36 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@user-none: you may well be right, as I said I have not looked into it in any detail. I assume highlighting matches and scrolling is how you do it in QPlainTextEdit, or do you use QRegExp?
|
10-12-2013, 10:08 PM | #37 | |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Quote:
QRegExp is severely limited. It's not even worth looking at. Qt 5 added QRegularExpression which is libPCRE based. It has full search support but doesn't offer robust replacement options. I don't use it in Sigil for user search and replace for this reason. I wrote a wrapper around libPCRE that allows me to search, replace and programmatically highlight and scroll to a match. |
|
10-12-2013, 10:12 PM | #38 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Also, I'll point out that Spyderlib has a robust QPlainTextEdit based editor written in Python that does most of what you'd want. It does a lot more than would be necessary but would still be a good starting point. At the very least it's a complete example in Python of what can be accomplished by subclassing a QPlainTextEdit.
|
10-12-2013, 10:14 PM | #39 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Thanks, I will look into how easy/difficult it is to get that working in the various editor choices, using the python re module.
And thanks for the link to spyderlib, that was what my starting point was going to have been for testing QPlainTextEdit. The idea of an editor component where I can control/modify a lot of the behavior in python is appealing. |
10-31-2013, 09:07 AM | #40 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I decided to go with QPlainTextEdit, frankly, none of the three choices were any good, even the most basic thing -- syntax highlighting -- was inadequate, so I realized I'd have to build my own. Which meant QPlainTextEdit.
Attached is a screenshot of what I have so far. The colors are fully themeable. Some nice features that were not present in any of the three choices: 1) Line numbers with current line highlighting in the numbers column 2) Themeablity 3) Decent syntax highlighting. Notice in the screenshot how: - CSS inside HTML <style> tags is highlighted - Invalid HTML is detected with a red underline and a tooltip telling you what is wrong - non-breaking spaces are highlighted with a slightly different background - The contents of title, heading, bold and italics tags are rendered using the appropriate bold/italic fonts - Namespace prefixes are highlighted Since I'd never built an editor before, this was a fun learning experience Last edited by kovidgoyal; 10-31-2013 at 09:09 AM. |
10-31-2013, 09:34 AM | #41 |
Grand Sorcerer
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
He says he'll put in a simple editor, and then goes and writes a vi clone
|
10-31-2013, 09:50 AM | #42 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Since I plan on using Tweak Book to replace my current use of vim for editing epubs, that editor needs to reach a stage where I am productive using it. And that is a pretty high bar
For the moment, I think I'll put editor work on hold and get back to finishing up Tweak Book, at least to the point where it's useful for non vim aficionados. I can always add smart indent, autocomplete and a vim emulation mode later, when I'm done with the basic Tweak Book functionality. Last edited by kovidgoyal; 10-31-2013 at 09:52 AM. |
10-31-2013, 12:45 PM | #43 | ||
Grand Sorcerer
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
Quote:
Quote:
|
||
10-31-2013, 10:33 PM | #44 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Certainly, vim is not for everyone. I am a bit of a vim nut, I even have my browser setup to behave like vim, using the pentadactyl firefox extension and my email client, mutt, is also very vim like. In fact I even wrote (well heavily modified an existing) window manager so I can control my desktop with the keyboard.
Anyway, this post was mainly to inform people that might be watching this thread that development work continues. The code is in the gui2/tweak_book and oeb/polish directories. |
11-07-2013, 12:43 AM | #45 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
And here's a screenshot of the editor, along with the preview panel inside Tweak Book.
Eventually, the preview panel will show live updates, i.e. as you type in the editor, the preview panel will update itself (with a second or so of delay) And the preview panel will track the cursor position in the editor, automatically scrolling to show the tag that you are currently editing inside. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to make Sigil live | varlog | Sigil | 136 | 10-25-2013 02:34 PM |
how many tocs does Sigil make? | Gregg Bell | Sigil | 17 | 01-31-2013 09:39 AM |
How do I make all .pdf's in my calibre library open in calibre instead of preview | morbo3000 | Library Management | 9 | 07-30-2011 10:39 AM |
using sigil to make changes befote conversion | alansplace | Sigil | 11 | 06-07-2011 07:50 AM |
i can't make sigil run in fedora 14 | nastarovia | Sigil | 1 | 01-20-2011 05:02 AM |