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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-25-2023, 05:52 AM   #1
galax
Member
galax began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Sep 2023
Device: none
External Editor and epub temp files

Greets,

Often times using the external editor come useful to fix some things, big HOWEVER, the external editor is vastly crippled the way it's implemented.

In order to find a work around I was trying to look for Sigil's epubs temp files in order to edit them directly and hope for Sigil to refresh the changes, but these temp files are nowhere to be found in Linux!

Sigil is great for previewing is there a way to resort editing the epub externally and have Sigil refresh the contents upon saving?

Wwowowo! I just tried external editor with latest Sigil and it goes haywire, arrows navigation writing random strings all over the text delayed character printing having to hit multiple times to work, etc.

Test 2: I found the 'Temp' files settings, so I set it manually then opened Section0001.xhtml, edited and wrote the changes, saddly the changes DO NOT appear in Sigil. Not even after closing text tab and reopening. This leads me to think that those temp files are fake temp files.

How is it possible that changing the file externaly AND closing Sigil's tab with same file won't show the changes after reopening the tab??

Anyways if anybody finds some workaround to this I would appreciate.

Thanks in advanced.
galax is offline   Reply With Quote
Old 09-25-2023, 07:47 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,374
Karma: 192286406
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by galax View Post
Greets,

Often times using the external editor come useful to fix some things, big HOWEVER, the external editor is vastly crippled the way it's implemented.

In order to find a work around I was trying to look for Sigil's epubs temp files in order to edit them directly and hope for Sigil to refresh the changes, but these temp files are nowhere to be found in Linux!

Sigil is great for previewing is there a way to resort editing the epub externally and have Sigil refresh the contents upon saving?

Wwowowo! I just tried external editor with latest Sigil and it goes haywire, arrows navigation writing random strings all over the text delayed character printing having to hit multiple times to work, etc.

Test 2: I found the 'Temp' files settings, so I set it manually then opened Section0001.xhtml, edited and wrote the changes, saddly the changes DO NOT appear in Sigil. Not even after closing text tab and reopening. This leads me to think that those temp files are fake temp files.

How is it possible that changing the file externaly AND closing Sigil's tab with same file won't show the changes after reopening the tab??

Anyways if anybody finds some workaround to this I would appreciate.

Thanks in advanced.
Don't edit sigil's temp files directly. It's a recipe for disaster. As to a workaround: the obvious one is to find out why Sigil's external editor feature goes "haywire" for you. That's not normal. And no... they are not "fake temp files". They are just not meant to be casually diddled while Sigil has them open.

Last edited by DiapDealer; 09-25-2023 at 10:36 AM.
DiapDealer is online now   Reply With Quote
Old 09-25-2023, 09:11 AM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,425
Karma: 5432724
Join Date: Nov 2009
Device: many
For speed, Sigil caches all text files in Qt widgets. So Sigil has to set FileWatchers to know when files have been modified underneath it. It only does that when it actually needs to. So when "Open With" is used it sets one on the target file you ran it on. When the XEditor is used it sets them on selected xhtml files from the spine.

As DiapDealer explained. Changing any of the files in Sigil's own temp directory without the proper FileWatchers present is a sure recipe for disaster.

So stick to using Open With and the XEditor the way they were designed. For anything else use a plugin to act as an interface to Sigil that properly handles things safely with copy on write semantics and result xml to safely change internal files.

My guess is you could just use Sigil's Open With feature to edit specific files with a different editor.

If XEditor is showing flakiness in any way, it is the result of your system or how you are using it. It works just fine on Linux, Windows, and Mac and has for quite some time.

Last edited by KevinH; 09-25-2023 at 10:08 AM.
KevinH is offline   Reply With Quote
Old 09-25-2023, 03:18 PM   #4
galax
Member
galax began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Sep 2023
Device: none
To illustrate what's going on I share this output after using external editor:

Code:
^[^[POBOBBOB6?xml version="1.0" encoding="ut^[8"?>
6!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title></title>
</head>

<body>
<p> </p>
</body>
</html^[^[P06r^[\OBOBBOB66b68=1
This is after starting sigil like this in the terminal:

Code:
sigil &
Whereas without the ampersand &, the text doesn't get random strings inserted into the file. It feels as if sigil is intercepting the keystrokes and sending random characters (hopefully not telemetry).

What's going on?

Is there a way to get a completely stand alone terminal with text based editor? It would help if sigil had an option for external editor such as

External Editor command:

myterm -more -options -etc

In preferences.

Thanks.
galax is offline   Reply With Quote
Old 09-25-2023, 04:39 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,425
Karma: 5432724
Join Date: Nov 2009
Device: many
It does. Did you read my response? Use Sigil's Open With feature to allow an external editor to handle the editing.

Why on earth are you trying to run Sigil in the background? It is a gui app. It is not a command line tool.

Launch Sigil normally. Set your editing program of choice for a specific file type with Open With ... menu in Sigil.

Once set you can right click on any text file in Sigil's BookBrowser and select OpenWith to launch it with your specified editor. Sigil will set the proper File Watcher to know when to absorb the changes.

All of this is explained in the Sigil User Guide.

Last edited by KevinH; 09-25-2023 at 04:43 PM.
KevinH is offline   Reply With Quote
Old 09-25-2023, 04:49 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,425
Karma: 5432724
Join Date: Nov 2009
Device: many
And If you decide to use XEditor or Open With, they can of course launch any shell script where you add any options you want.

Just stop trying to run Sigil as a background process and trying to pipe things into and out of that process.
KevinH is offline   Reply With Quote
Old 09-25-2023, 04:55 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,374
Karma: 192286406
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
As Kevin mentioned, Sigil is a gui tool, it CAN'T run in the background. The only command-line parameter that sigil on Linux accepts is the path to an epub it should open.

Quote:
It feels as if sigil is intercepting the keystrokes and sending random characters (hopefully not telemetry).
Please don't play the silly FUD game. Sigil does nothing of the sort. It is 100% opensource. The code is there for anyone to verify that nothing nefarious is happening. If you want help getting this sorted, we will be happy to help. But the unfounded, and unwarranted, paranoia needs to stop first.
DiapDealer is online now   Reply With Quote
Old 09-25-2023, 04:58 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,374
Karma: 192286406
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by galax View Post
Is there a way to get a completely stand alone terminal with text based editor? It would help if sigil had an option for external editor such as

External Editor command:

myterm -more -options -etc

In preferences.

Thanks.
Nothing like that is necessary in Sigil's preferences. Just create a bash script with the command(s) you want, make it executable and configure Sigil's "Open With" feature (right-click file in Book Browser), or the "Launch External XHTML Editor" feature to launch the bash script. But a terminal emulator is not an editor. So how are you hoping to edit xml/xhtml by merely opening a terminal? The External Editor is passing a file name (or file names) as a parameter to be opened by an executable program (or at least accepted as a parameter to a bash script).

And if you're trying to print stuff to a terminal emulator in order to capture the output, there's character encoding to factor in.

Last edited by DiapDealer; 09-25-2023 at 06:13 PM.
DiapDealer is online now   Reply With Quote
Old 09-26-2023, 12:11 PM   #9
galax
Member
galax began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Sep 2023
Device: none
My apologies,

After reading the reply a second time I realized about the "Open with" option in the menus. Now it works correctly.

During my further, incorrectly, testings, the terminal broke even more, turning RED and not even CTRL working. Like this.

Code:
>▮▮▮▮▮▮▮▮▮
>▮▮▮▮▮▮▮▮▮
>▮▮▮▮▮▮▮▮▮
>▮▮▮▮▮▮▮▮▮
>▮▮▮▮▮▮▮▮▮
There was no way of getting out of the terminal. Is that some QT behaviour? Does QT take over the terminal or something? Regardless is not that I'll try it again.

Getting back to the proper way of using a terminal, I meant terminal for a text based editor. I am interested in this part:
Quote:
Just create a bash script with the command(s) you want, make it executable
So it looks quite flexible then.

Even though "Open with" works as expected, one file at a time is a bit limiting. Some of my doubts are the following:

- Would it be possible to launch "Open with" with a shortcut?
- Is there a realistic way of opening multiple files at once? (During editing it's normal to go back and forth through several files)

Right clicking each time on every chapter or file is too cumbersome the extra steps. As soon as I select more than one file "Open with" is greyed out.

Basically I need full access to the entire epub externally, would this be possible?

Thanks.
galax is offline   Reply With Quote
Old 09-26-2023, 02:16 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,425
Karma: 5432724
Join Date: Nov 2009
Device: many
Quote:
Basically I need full access to the entire epub externally, would this be possible?
No, not while it is being edited by Sigil. Sounds like you have no idea how to use Sigil's extensive Find and Replace across files or use of Sigil in general like having multiple tabs open.

No matter. An epub is just a fancy zip with the first file in the zip being an uncompressed mimetype file.

So either just unzip the epub and go to town on it then use Sigil's FolderIn plugin to read it back into Sigil. Or take Sigil out of the loop and learn the sequence of steps to rezip up an epub properly. It can be easily done.

Last edited by KevinH; 09-26-2023 at 04:56 PM.
KevinH is offline   Reply With Quote
Old 09-26-2023, 06:05 PM   #11
jmurphy
Connoisseur
jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.
 
Posts: 80
Karma: 500000
Join Date: Sep 2007
Device: ipaq
You haven't really said what you want to do, you've just focused on using an external editor.

"Is there a realistic way of opening multiple files at once? (During editing it's normal to go back and forth through several files)"

So just open multiple files in Sigil. On the left hand side, in the book browser, double-click each file you want to open. You will have multiple files open and can go back and forth between them. No external editor needed.
jmurphy is offline   Reply With Quote
Old 09-26-2023, 07:57 PM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,374
Karma: 192286406
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Has this really been about getting access to an epub's internal files so they can be edited in a terminal program all along? If so, Sigil is just in your way.
DiapDealer is online now   Reply With Quote
Old 10-07-2023, 05:01 AM   #13
galax
Member
galax began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Sep 2023
Device: none
Mmm..

Perhaps the solution I am looking for doesn't exist. I needed Sigil as final renderer, and some quirks fixings. Somehow FolderIn/FolderOut kinda works.

However the 'External Editor' menu option is perfect the only problem is that works with one file at a time.

Would it be possible to automate 'External Editor' to open the entire project in a Single click? Or perhaps make more flexible by choosing any number of files.

Some editors can write changes back to it, in this way editing could take place in both places, Sigil and 'External Editor'.

thanks.
galax is offline   Reply With Quote
Old 10-07-2023, 10:21 AM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,425
Karma: 5432724
Join Date: Nov 2009
Device: many
PageEdit app already does this with Sigil for xhtml files. And yes using the XEditor with PageEdit allows Sigil to pass in the OPF which allows PageEdit to work in any XHTML file and easily change to others using arrow buttons. But it edits one file at a time by design. If you use OpenWith instead of the XEditor interface you could have multiple files open in Sigil's Tabs each with its own external editing app/window.

The rendering role is filled by Sigil's Preview and/or the PageEdit.app or really any browser you might have.

Since, you do not seem to understand how Sigil was designed to be used or what role it plays, why don't you just unzip the epub, edit any files you want in any way and use a browser to show you the result.

Last edited by KevinH; 10-07-2023 at 11:24 AM.
KevinH is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
External viewer opens temp file Aiwass Library Management 4 04-29-2013 05:44 AM
External links in EPUB files? toolong ePub 3 06-21-2011 10:37 PM
Temp files... BadGandalf Calibre 17 10-24-2010 12:38 PM
Temp files Jeff L Calibre 3 10-14-2010 06:58 PM
LIT-to->EPUB conversion leaving behind temp files? Stinger Calibre 1 06-20-2010 10:31 PM


All times are GMT -4. The time now is 06:43 PM.


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