Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 11-30-2013, 09:48 PM   #121
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by mrmikel View Post
One useful thing that Sigil does in its book view is it allows you to join broken paragraphs just by deleting everything in between on the screen. That is not something that is available in code view. I am not sure there is an answer for this with this program...maybe there shouldn't be given the unpredictable skill level that could knock out things worth keeping. But I thought I would mention it.

But this is not a high priority item considering the tremendous demands on your time.
Would that really be a good idea anyway? The calibre editor won't ever (from the sound of it) be a WYSIWYG editor, and if you know what you are doing, it's much better to edit the code directly, instead of depending on WYSIWYG attempts to do it in an all-encompassing manner.

Sigil, when used like that, suffers the general problem of Sigil when used in Book view, that you end up with weird code in your new paragraph. (Although it does display as a single paragraph.)

You could always delete "</p>\n<p( class|id|style="whatever")>" directly to merge your paragraphs.
eschwartz is offline  
Old 11-30-2013, 10:02 PM   #122
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: 30,447
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I would second eschwartz. Some things are best done in CV where you can see the paragraph code variants .
I have 3 saved REGEX saved searches, of which only 1 can safely be run: 'Replace All' on the whole book.
Another can be run Replace All, but only for 'Selected files' (the main book. Not the rest that may not use lines without ending punctuation)

The third is only run ('selected files) Find/Replace-Next , Carefully, reading the context before hitting the 'Replace'

All else are hand crafted to the situation: <p class="stuff"><span class=...
theducks is offline  
Advert
Old 11-30-2013, 11:55 PM   #123
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Not only that, if you ask me it's ridiculously easy to merge paragraphs in code view. Sigil can always be used for those who wish a full WYSIWYG editor; Kovid said he doesn't really want to introduce Book View editing:

Quote:
Originally Posted by kovidgoyal View Post
@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.
eschwartz is offline  
Old 12-01-2013, 06:44 AM   #124
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Having problem running this on OSX (Mavericks)
Just tried running v1.13, editor window comes up, but then getting error.
(tried with using filename in cli and loading file from menu-item)

Code:
calibre, version 1.13.0
ERROR: Failed to open book: Failed to open book, click Show details for more information.

Traceback (most recent call last):
  File "site-packages/calibre/gui2/tweak_book/job.py", line 34, in run
  File "site-packages/calibre/gui2/tweak_book/boss.py", line 38, in get_container
  File "site-packages/calibre/ebooks/oeb/polish/container.py", line 1077, in get_container
  File "site-packages/calibre/ebooks/oeb/polish/container.py", line 830, in __init__
  File "site-packages/calibre/ebooks/oeb/polish/container.py", line 136, in __init__
InvalidBook: Could not locate opf file: u'/private/var/folders/0_/21d52lxx21bfb5856_zk4y6r0000gn/T/calibre_1.13.0_tmp_FNhgvU/Sm1p4D/00000-7ZCvgG/OEBPS/content.opf'
Any ideas on how to get it going?
Perkin is offline  
Old 12-01-2013, 06:56 AM   #125
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by Perkin View Post
Having problem running this on OSX (Mavericks)
Just tried running v1.13, editor window comes up, but then getting error.
(tried with using filename in cli and loading file from menu-item)
...
Any ideas on how to get it going?
This was reported and fixed in the source.

Quote:
Originally Posted by kovidgoyal View Post
@Griker: No need to send me a book, I think I know what the problem is, it is caused by OS X's use of symlinks for /tmp

I will implement a fix when I have some time to work on OS X.

EDIT: Fix committed, if you run from source, it should work.
If you don't run from source wait until the next update (usually Fridays) and try again.

Last edited by DoctorOhh; 12-01-2013 at 06:58 AM.
DoctorOhh is offline  
Advert
Old 12-01-2013, 07:07 AM   #126
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Thanks Doc
I saw there was a few fixes, thought they were done before the 1.13 release.
I'll probably wait for next release. (I haven't had mac long - so still getting used to how it does stuff, yet to look into running from source on it)
Perkin is offline  
Old 12-01-2013, 04:51 PM   #127
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Opening and editing an azw3 gets me the following error when I try to save it:
calibre, version 1.13.0
ERROR: Could not save: Saving of the book failed. Click "Show Details" for more information.

Code:
Traceback (most recent call last):
  File "site-packages/calibre/gui2/tweak_book/save.py", line 100, in process_save
  File "site-packages/calibre/gui2/tweak_book/save.py", line 109, in do_save
  File "site-packages/calibre/ebooks/oeb/polish/container.py", line 1066, in path_to_ebook
AttributeError: 'AZW3Container' object has no attribute 'pathtoepub'
when global search and replace, gives response of(copied to clipboard):

Quote:
calibre, version 1.13.0
Searching done: Replaced 25 occurrences of <div style="page-break-after:always"></div><div class="pagebreak">&nbsp;(<a id="[a-zA-z0-9]*"></a>)?</div>\n
but visually shows:

Quote:
Replaced 25 occurrences of
()?
\n
It looks like that status message is being mangled somehow.

Likewise, whenever you try to do certain changes (like rename a file) I get the alert:

Click image for larger version

Name:	calibre-tweak-error.png
Views:	237
Size:	38.4 KB
ID:	116063

which in addition to being somewhat confusing -- why should renaming a file or deleting a stylesheet cause a loss of "unsaved changes", what are these changes anyway (After testing it, I don't see anything missing) -- this also has the end of the message cut off.
eschwartz is offline  
Old 12-01-2013, 10:53 PM   #128
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: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The saving azw3 bug was a typo, fixed.

The message not displaying properly was caused by html not being escaped, also fixed.

You get the message about unsaved changes if you have editors open with unsaved changes in them. Those changes could have been generated by a previous global S&R operation, for example. Renaming files changes file contents since all links and references to the file throughout the book have to be updated.

Last edited by kovidgoyal; 12-01-2013 at 10:56 PM.
kovidgoyal is offline  
Old 12-02-2013, 01:03 AM   #129
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by kovidgoyal View Post
You get the message about unsaved changes if you have editors open with unsaved changes in them. Those changes could have been generated by a previous global S&R operation, for example. Renaming files changes file contents since all links and references to the file throughout the book have to be updated.
What exactly is an unsaved change, and how do you save it? Is it because the core behind the editor is the same exploded ebook as the original tweak?

Shouldn't the editor take care of saving all changes automatically?
eschwartz is offline  
Old 12-02-2013, 01:12 AM   #130
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: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
An unsaved change is just that, a change to the text in an open editor that has not yet been saved.

You save it by clicking the save button, just as you would in any other editor. The only difference is that Tweak Book has two save buttons, one for every individual editor and a global one that saves all open editors.

Editors dont save changes automatically, that would be a recipe for disaster. If you have unsaved changes in editors before performing any sort of operation that works on the underlying book, such as rename, you will get a confirmation message about it.
kovidgoyal is offline  
Old 12-02-2013, 02:41 AM   #131
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: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@eschwartz: There are some circumstances in which the notification about unsaved changes can crop up erroneously, that will be fixed in the next release.
kovidgoyal is offline  
Old 12-02-2013, 03:32 AM   #132
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Ah, I see! For some reason I didn't notice that in addition to the main toolbar, there is a toolbar in the editor component. I assume that one just saves to the exploded ebook, and the main save button saves the current explosion back to the original source?

I guess I'm just too used to the Sigil layout, I was thinking about it the way I would think about saving in Sigil. However Sigil manages it, it keeps track of all that stuff on the fly and you just have to worry about saving back to the source epub when done.

On another note, I've noticed, now I've been trying things out, that when calibre generates/edits a ToC, it insists on using UUID's for the link, even with header elements that are traditionally the very first element. Sigil will just link to the page itself... now that I come to check it, for the first link on any file. Huh.

Would it be possible, somehow, to select the actual file, instead of an element within the file, to link to? And also, when autogenerating a ToC from major headings, to check if the link is to the first element, and just head straight to the top? It's essentially unnecessary code, and I think it would be nice if calibre could detect that and avoid creating it.
eschwartz is offline  
Old 12-02-2013, 04:37 AM   #133
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: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You are right that having two saves is somewhat confusing, I think I will look into doing away with the per editor save for the future. So when you perform any action on the book, the action automatically uses the latest text from all open editors, without needing to save first.

As for detecting if a link is to an element at the top of the file, that is certainly do-able, however, not particularly high priority. Feel free to ping me about it after Tweak Book is released.
kovidgoyal is offline  
Old 12-02-2013, 07:41 AM   #134
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: 44,548
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I have uploaded new builds here:
http://download.calibre-ebook.com/betas/

The changes:

1) Fix all reported bugs

2) Add preferences to customize keyboard shortcuts and the look of the editor (Edit->Preferences)

3) Integrate into calibre, replacing the old Tweak Book function, so that it now launches the new editor

4) Various small features, like replacing files, exporting files from the book to the disk, recently opened books, have only a single save book action, a save as option to save copies of the book and so on...

In my opinion the tool is now a useable replacement for Sigil. It is still missing some features, but those will come with time.

Please help test it, so that I can iron out the major remaining bugs and release it to the general public. I will post updated builds with bug fixes as bugs are reported.

Last edited by kovidgoyal; 12-02-2013 at 07:44 AM.
kovidgoyal is offline  
Old 12-02-2013, 09:14 AM   #135
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
I'm running from source, and I downloaded and installed the latest beta build. I have the 'Tweak Book' icon added to a toolbar. When I click it, I get the old dialog prompting me to explode the book.

Is there another setting required to go straight to the editor?

G
GRiker is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Sigil live varlog Sigil 136 10-25-2013 03:34 PM
how many tocs does Sigil make? Gregg Bell Sigil 17 01-31-2013 10: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 11:39 AM
using sigil to make changes befote conversion alansplace Sigil 11 06-07-2011 08:50 AM
i can't make sigil run in fedora 14 nastarovia Sigil 1 01-20-2011 06:02 AM


All times are GMT -4. The time now is 12:58 AM.


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