Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 10-10-2013, 02:27 PM   #31
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
Quote:
Originally Posted by Perkin View Post
Yes, use whichever component will allow easiest adaptation by users adding features after Kovid has set it all up and handed off further development to 'normal' users.
Indeed. I've tried to use Tweak Book as it is now, for some more stuff than only adding a bit of CSS, but it's no fun to navigate files that way and use an external editor. Sigil works works much better if you want to do more extensive stuff, just because it has "simple" things like a file browser and such.

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.)
Katsunami is offline  
Old 10-10-2013, 09:06 PM   #32
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Quote:
Originally Posted by kovidgoyal View Post

@theducks: There isn't going to be a book view. There will be a preview panel that will stay synced backwards and forwards with the code view, but you wont be able to edit directly in the preview panel. At least I have no interest in implementing that.
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.
mrmikel is offline  
Advert
Old 10-10-2013, 09:57 PM   #33
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by kovidgoyal View Post

@theducks: There isn't going to be a book view. There will be a preview panel that will stay synced backwards and forwards with the code view, but you wont be able to edit directly in the preview panel. At least I have no interest in implementing that.
I don't mind working in CV (although a Join/split is easier in BV because there are no tags there).
A Solid (view) Synch is good . Bi-directional would be outstanding.
theducks is offline  
Old 10-10-2013, 10:28 PM   #34
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline  
Old 10-12-2013, 09:26 PM   #35
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by kovidgoyal View Post
EDIT: In fact whatever editor component is used, I highly doubt we will rely on its regex engine, since there needs to be the ability to run regexes on all the files in the book and the regex engine for that must be the same as that used in the editor.

In fact the scintilla documentation even has a section on doing just that: http://www.scintilla.org/ScintillaDoc.html#Searching
Let me clarify. QScintilla basically needs you to hook a regular expression engine into the editor itself. Which is what that link says you need to do. Last time I looked at how you need to hook in an alternative regex engine it was non-trivial. The "highlighting matched text and scrolling to the highlights " part is which is the easy way to handle adding regex support is even more difficult to do.
user_none is offline  
Advert
Old 10-12-2013, 09:44 PM   #36
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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?
kovidgoyal is offline  
Old 10-12-2013, 10:08 PM   #37
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by kovidgoyal View Post
@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?
Highlighting matches and scrolling is what I use in Sigil.

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.
user_none is offline  
Old 10-12-2013, 10:12 PM   #38
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
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.
user_none is offline  
Old 10-12-2013, 10:14 PM   #39
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline  
Old 10-31-2013, 09:07 AM   #40
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
Attached Thumbnails
Click image for larger version

Name:	editor.png
Views:	430
Size:	88.0 KB
ID:	114346  

Last edited by kovidgoyal; 10-31-2013 at 09:09 AM.
kovidgoyal is offline  
Old 10-31-2013, 09:34 AM   #41
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
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
Katsunami is offline  
Old 10-31-2013, 09:50 AM   #42
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline  
Old 10-31-2013, 12:45 PM   #43
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
Quote:
Originally Posted by kovidgoyal View Post
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
Heh, I can imagine. While I'm not lost when using Vim and can get stuff done, I'm by no means a Vi(m) wizard. To be honest, I prefer a... "normal" editor, if you can call it that

Quote:
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.
I think that this is a very sane idea. Vim-type editors can be very fast to work with, but they do have a steep learning curve and need a lot of practice.
Katsunami is offline  
Old 10-31-2013, 10:33 PM   #44
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline  
Old 11-07-2013, 12:43 AM   #45
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
Attached Thumbnails
Click image for larger version

Name:	editor.png
Views:	421
Size:	524.5 KB
ID:	114803  
kovidgoyal is offline  
Closed Thread


Forum Jump

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


All times are GMT -4. The time now is 11:34 AM.


MobileRead.com is a privately owned, operated and funded community.