![]() |
#1 |
Member
![]() Posts: 12
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. |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,215
Karma: 191422320
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Last edited by DiapDealer; 09-25-2023 at 10:36 AM. |
|
![]() |
![]() |
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,326
Karma: 4622346
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. |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 12
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 Code:
sigil & 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. |
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,326
Karma: 4622346
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. |
![]() |
![]() |
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,326
Karma: 4622346
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. |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,215
Karma: 191422320
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:
|
|
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,215
Karma: 191422320
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#9 | |
Member
![]() Posts: 12
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:
>▮▮▮▮▮▮▮▮▮ >▮▮▮▮▮▮▮▮▮ >▮▮▮▮▮▮▮▮▮ >▮▮▮▮▮▮▮▮▮ >▮▮▮▮▮▮▮▮▮ 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:
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. |
|
![]() |
![]() |
![]() |
#10 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,326
Karma: 4622346
Join Date: Nov 2009
Device: many
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
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. |
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,215
Karma: 191422320
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.
|
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 12
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. |
![]() |
![]() |
![]() |
#14 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,326
Karma: 4622346
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. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
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 |