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 08-19-2021, 02:27 PM   #16
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: 5,769
Karma: 3571822
Join Date: Nov 2009
Device: many
There is one other thing that might work. Right now, Sigil has an External Xhtml editor preference and icon that is typically used to interface to PageEdit (a wysiwyg live editing of a xhtml pages) and it will pass along the entire internal unpacked path to the OPF and it will start a file watcher on all xhtml files for changes. These file watchers are only for xhtml files, though. New resources, or changes in images, css, fonts, etc resources are not watched for since PageEdit is meant for editing xhtml only while adding links to existing images, media, etc.
KevinH is offline   Reply With Quote
Old 08-19-2021, 03:29 PM   #17
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: 24,548
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It only passes the OPF file and sets up the watcher for all xhtml files if the external editor is named "pageedit", now. Otherwise, it only passes the current xhtml file to other programs. We had to change that because the earlier approach basically limited the external editor button to be used for PageEdit. The couldn't edit xhtml files with a different xhtml editor assigned to the button.

Also keep in mind that the button can be assigned to a batch file that could do all kinds of theoretical processing before passing the xhtml file in question to an external editor.
DiapDealer is online now   Reply With Quote
Advert
Old 08-19-2021, 04:11 PM   #18
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: 5,769
Karma: 3571822
Join Date: Nov 2009
Device: many
But if you launch it when the OPF is the current file it should enable file watchers for all the xhtml files no matter what target (ie. PageEdit or not) is used. If not, I think we should put it back that way.

What do you think?


Quote:
Originally Posted by DiapDealer View Post
It only passes the OPF file and sets up the watcher for all xhtml files if the external editor is named "pageedit", now. Otherwise, it only passes the current xhtml file to other programs. We had to change that because the earlier approach basically limited the external editor button to be used for PageEdit. The couldn't edit xhtml files with a different xhtml editor assigned to the button.

Also keep in mind that the button can be assigned to a batch file that could do all kinds of theoretical processing before passing the xhtml file in question to an external editor.
KevinH is offline   Reply With Quote
Old 08-19-2021, 05:04 PM   #19
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: 24,548
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm not sure I can put it back. The logic is pretty twisted already. Right now, it passes the highlighted xhtml file as an argument to the external editor (and the filewatcher is started). Unless the external editor in question is PageEdit, in which case the OPF file and the currently highlighted xhtml file are both passed to PageEdit as arguments (and the multiple watchers are set up by parsing the opf). If no xhtml file is highlighted in Book Browser, nothing happens (see message in status bar). It was determined that users who wanted to open a single xhtml file with PageEdit could do so via the right-click "Open With" in Book Browser.

I guess it just doesn't seem that intuitive to me to select an opf file in Book Browser before activating an external xhtml editor. But I'm up for anything if we can figure it out without breaking the current functionality.

Last edited by DiapDealer; 08-19-2021 at 05:11 PM.
DiapDealer is online now   Reply With Quote
Old 08-20-2021, 08:28 AM   #20
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: 24,548
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
But if you launch it when the OPF is the current file it should enable file watchers for all the xhtml files no matter what target (ie. PageEdit or not) is used. If not, I think we should put it back that way.

What do you think?
Quote:
Originally Posted by DiapDealer View Post
I'm not sure I can put it back. The logic is pretty twisted already. Right now, it passes the highlighted xhtml file as an argument to the external editor (and the filewatcher is started). Unless the external editor in question is PageEdit, in which case the OPF file and the currently highlighted xhtml file are both passed to PageEdit as arguments (and the multiple watchers are set up by parsing the opf). If no xhtml file is highlighted in Book Browser, nothing happens (see message in status bar). It was determined that users who wanted to open a single xhtml file with PageEdit could do so via the right-click "Open With" in Book Browser.

I guess it just doesn't seem that intuitive to me to select an opf file in Book Browser before activating an external xhtml editor. But I'm up for anything if we can figure it out without breaking the current functionality.
Apparently I'm all wet on this. The Launch External xHmtl editor feature isn't working at all the way I intended it to with my last few changes.

It seems when PageEdit is defined as the external editor, PageEdit is launched with all xHtml resources available regardless of what kind of file is highlighted in Book Browser. Doesn't matter if it's an image, or a css file, or the opf file.

When the External xHTML Editor is defined as something other than PageEdit only xHTML resources can opened.

The latter is as I intended, but the former is not.

Though it's still not the end of the world at that. Always launching PageEdit with all html resources available whenever clicking the Launch External xHTML button was always the intended goal (whenever PageEdit is defined as the external editor, that is).

Last edited by DiapDealer; 08-20-2021 at 09:32 AM.
DiapDealer is online now   Reply With Quote
Advert
Old 08-20-2021, 09:19 AM   #21
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: 5,769
Karma: 3571822
Join Date: Nov 2009
Device: many
I will take a look at it this weekend sometime.
KevinH is offline   Reply With Quote
Old 08-20-2021, 08:09 PM   #22
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 17,526
Karma: 20473555
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
. . .
I guess it just doesn't seem that intuitive to me to select an opf file in Book Browser before activating an external xhtml editor. But I'm up for anything if we can figure it out without breaking the current functionality.
Makes sense to me - it's not unlike sending a playlist to a media player/editor.


Quote:
Originally Posted by DiapDealer View Post
Apparently I'm all wet on this. The Launch External xHmtl editor feature isn't working at all the way I intended it to with my last few changes.

It seems when PageEdit is defined as the external editor, PageEdit is launched with all xHtml resources available regardless of what kind of file is highlighted in Book Browser. Doesn't matter if it's an image, or a css file, or the opf file.

When the External xHTML Editor is defined as something other than PageEdit only xHTML resources can opened.

The latter is as I intended, but the former is not.

Though it's still not the end of the world at that. Always launching PageEdit with all html resources available whenever clicking the Launch External xHTML button was always the intended goal (whenever PageEdit is defined as the external editor, that is).
FTR:
I don't have anything in the External xHTML Editor setting, and I don't use buttons; so, any changes relating to the above shouldn't effect me.

However, I do use Page Edit via Book Browser->Open With - a lot. This is how I use it:

When I open a specific xhmtl with PageEdit I only have access to that specific file in Page Edit. To get the entire book into Page Edit I open the opf via the Book Browser->Open With.

I would 'hate' for le ménage à trois between me, Sigil, and Page Edit to change - it's a Perfect Match

BR

Last edited by BetterRed; 08-20-2021 at 08:13 PM.
BetterRed is offline   Reply With Quote
Old 08-20-2021, 09:33 PM   #23
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: 5,769
Karma: 3571822
Join Date: Nov 2009
Device: many
I am surprised the just an "Open With" on the OPF works for you at all as it does not set the File Watchers on the xhtml files. But if you do the same thing using the External XEditor shortcut or icon it does set the file watchers properly.

What exact version of Sigil are you using?
KevinH is offline   Reply With Quote
Old 08-21-2021, 04:36 AM   #24
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 17,526
Karma: 20473555
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by KevinH View Post
I am surprised the just an "Open With" on the OPF works for you at all as it does not set the File Watchers on the xhtml files. But if you do the same thing using the External XEditor shortcut or icon it does set the file watchers properly.

What exact version of Sigil are you using?
Sigil 1.7 and PageEdit 1.7 on Windows 10 21H1.

How would I know if the file watchers are set?

If I set the Preference to PageEdit and use the Launch External Editor toolbar button on an individual html file I get the entire book in Page Edit. I gather that is what you would expect

If I set the Preference to PageEdit and use Book Browser->Open With->Page Edit (BBOWPE) on a specific HTML file I only get that file, and if I use BBOWPE on the OPF I get the entire book in Page Edit.

So, launching PE via the toolbar button produces a different behaviour to launching it from Book Browser->Open With.

It goes without saying, I'm hoping the behaviour of BBOWPE remain as is.

BR

Last edited by BetterRed; 08-21-2021 at 04:40 AM.
BetterRed is offline   Reply With Quote
Old 08-21-2021, 05:17 AM   #25
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 17,526
Karma: 20473555
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@KevinH - didn't know there was a kb shortcut slot for the external editor, but I just tested it and as you predicted it behaves same as the button.

BR
BetterRed is offline   Reply With Quote
Old 08-21-2021, 07:16 AM   #26
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: 24,548
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
That was indeed the intended behavior. Launching the external editor with PE defined would give access to the whole book by default. Those who wanted to only edit individual xhtml files with PE could use the Book Browser's Open With.

PageEdit itself accepts an opf as an input file, so it makes sense that if you've configured PageEdit as an external editor for opf files, that it open s the whole book. But as Kevin mentioned, no file watchers are set up for the xhtml files using that method. There is only a file watcher set up for the opf file. So when saving changes to xhtml files via PE in that scenario, there would be no signal to Sigil to refresh/reload those changed files.

Perhaps you only ever preview the entire epub using PE when launching it as external opf editor?
DiapDealer is online now   Reply With Quote
Old 08-21-2021, 07:39 AM   #27
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: 24,548
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
@KevinH : what about making the Book Browser's OpenWith set file watchers for all xhtml resources when the opf file is the selected resource?

That could pave the way for the (partial) solution you envisioned for FriedGopher's predicament while leaving the logic of the External xHTML Launched alone (as well as not change any usage that BR is accustomed to).

Seems to me that special-casing the Launch External xHTML button even further doesn't make a lot of sense when that button/feature was intended to simplify things for new users.
DiapDealer is online now   Reply With Quote
Old 08-21-2021, 09:28 AM   #28
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: 5,769
Karma: 3571822
Join Date: Nov 2009
Device: many
Yes, the ExternalXEditor with the latest changes in 1.7 when used for PageEdit was meant to work the same way each time. If the current tab was an xhtml file Sigil would pass the opf and spine number of that file to PageEdit which should allow editing of all xhtml files but open with the selected xhtml as active on top.

If the current tab was the opf file, it did the same but opens with the first file listed in the spine in top as active.

That way it is as easy to open and edit a single xhtml file as the current tab is made active (on top) in PageEfit with the added bonus of working insert media, insert links, etc.

This was done both to simplify things for new users of PageEdit and also to allow PageEdit tools like insert link, insert image, etc to work properly all of the time (they require the opf info to work).

When passing the opf, filewatchers need to be properly set on all xhtml files and only the ExternalXEditor tool does that now.

OpenWith is set up to only deal with a single file at a time. I am not sure I want to change that, as it would just confuse things further. For example if you like to edit xml using your favourite xml editor, you should be able to launch and just watch that opf or ncx file just like any other file.

That was why a different mechanism than Open With was needed for PageEdit.

Last edited by KevinH; 08-21-2021 at 10:03 AM.
KevinH is offline   Reply With Quote
Old 08-21-2021, 10:47 AM   #29
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: 24,548
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
For advanced users, the current (1.7) code would allow someone to "trick" the Launch External xHTML Editor into watching all of the xhtml resources while sending the full path of the opf file (as well as the currently selected xhtml resource) to something other than PageEdit. Just create a script named "pageedit" (or pageedit.bat or pageedit.cmd on Windows) and define it as the External xHTML Editor. That should open the door to custom parsing of the opf and the potential to create custom routines for editing multiple xhtml resources.

Last edited by DiapDealer; 08-21-2021 at 10:50 AM.
DiapDealer is online now   Reply With Quote
Old 08-21-2021, 10:56 AM   #30
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: 5,769
Karma: 3571822
Join Date: Nov 2009
Device: many
Yes, that should work.

I do think we should still check if the current tab is an xhtml file or an opf file and if not return an error like we did back in the Sigil 1.5.1 timeframe with launchWithXEditor.

I will add that in.

This still won't help BetterRed as his way of doing it is just not setting the necessary file waters unless that code exists someplace else in Sigil and we just do not know it. This code base is getting big and even after more than 5 years I still do not know everything about the code yet. I will search Sigil to see if that is the case.

If not, BetterRed, you should use the keyshortcut for the XEditor when using PageEdit when the OPF is passed and not Open Width as some of your changes could be lost otherwise.


Quote:
Originally Posted by DiapDealer View Post
For advanced users, the current (1.7) code would allow someone to "trick" the Launch External xHTML Editor into watching all of the xhtml resources while sending the full path of the opf file (as well as the currently selected xhtml resource) to something other than PageEdit. Just create a script named "pageedit" (or pageedit.bat or pageedit.cmd on Windows) and define it as the External xHTML Editor. That should open the door to custom parsing of the opf and the potential to create custom routines for editing multiple xhtml resources.

Last edited by KevinH; 08-21-2021 at 10:58 AM.
KevinH is offline   Reply With Quote
Reply

Tags
refresh, reload, update

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil with audio files smarsten Sigil 16 04-07-2015 10:07 AM
Sigil has trashed more files JimmyG Sigil 37 05-04-2013 05:32 PM
Multiple files, *-tmp.epub, are left in /tmp/Sigil/scratchpad after closing Sigil Ahmad Samir Sigil 8 11-28-2012 04:27 AM
Sigil 024 and regular expressions on "all HTML files" WS64 Sigil 4 08-13-2010 07:33 PM
Sigil and CSS files crutledge Sigil 6 05-20-2010 09:02 AM


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


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