![]() |
#166 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Does Sigil need a Big Green Publish Button?
Hi All,
Does Sigil, sometime in the future, need something like a big green "Publish" button that would: - regenerate the Nav, and any html TOC - automatically run Mend and Prettify on all code - update all manifest properties in the OPF - add in the NCX/Guide for backwards compatibility with older EPUB2 only readers - add in missing xml:lang, lang, and titles - add in missing Aria roles - add in accessibility metadata - verify no errors from epubcheck - verify no errors from ACE - do the equivalent of a save-as to a "Completed Works" folder. - and finally remove all its previously created checkpoints in the repo Perhaps then we could add a Publish Preferences setting dialog that would allow you to indicate which of these steps you want to use, the path to the "Completed Works" folder and etc. Would something along those lines be useful? KevinH |
![]() |
![]() |
![]() |
#167 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 808
Karma: 2416112
Join Date: Jan 2017
Location: Poland
Device: Various
|
Hello,
In theory, I would be in favor of implementing such a button, but working with real EPUB files makes these elements less useful to me personally. However, I believe that for many people it would be a gift that would make the result files in the wild better. ----- It would be much more interesting to implement, for example, saving search parameters (already discussed in the thread with proposals), and by the way, I would be very pleased with the Issue #220 solution. ----- Still, a button like this could be handy. Becky |
![]() |
![]() |
![]() |
#168 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Saving search parameters is already on my future to-do list (see an earlier post in this thread) and this is not a zero sum game since we are talking about over the next year or 2 or even 3.
Issue #220 can already be done with specially crafted regular expressions with look ahead and look behind to rule out unclosed html tags. Alternatively we could strip out all tags but keep track of the starting position of each character (or word maybe) and then do search on that. The problem is how to do replace when the found text to be replaced spans multiple nodes in the tree. This is actually a hard problem to solve. That is why find and replace in most browsers is limited to contiguous strings which of course breaks down when markup tags, spans, drop caps, etc are involved. Until I can think of some way of solving that issue, we are limited to using complex regular expressions to rule out the contents of the tags themselves. So all of these suggested new features should be viewed on their own merit. Let us (the Sigil developers) worry about their priority. We will only accept new feature suggestions that we feel we can actually handle and that are doable without major rewrites of Sigil (I am done with major rewrites of Sigil, there are very very few files I have not had to edit over the last 5 years so I really do not want to have to repeat that anytime soon.) Thanks for your input! |
![]() |
![]() |
![]() |
#169 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
FYI,
Here is a simple example to find the word "title" *not* inside a tag itself, here is the simplest regex search I could think of off the top of my head. It assumes there is no bare text in the body tag and that the xhtml is well formed. I tried it and it appears to work. There are probably better more exhaustive regex, that can handle even broken xhtml. Code:
title(?=[^>]*<) There are probably look behind versions that could work with reverse logic. And there are ways to use regex to find a two strings that ignores any intervening tags. Give it a try. You could add a saved search easily to do that. But again it will not handle find and replacement of text that crosses over elements (over nodes in the tree). That is the hard part unless you have one to one corresponding matching of matching substrings to replacement substrings which in general need not be the case. And of course if you use < and > inside strings to show a "tag" or code snippet, these would be found by mistake so reviewing each find before the replace would be needed. Last edited by KevinH; 03-06-2021 at 01:24 PM. |
![]() |
![]() |
![]() |
#170 | ||||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
I Right-Clicked the "Search Results" box at the bottom, and there's a setting called "Word wrap long lines". That fixes one little issue I had. :P Quote:
![]() ![]() Quote:
The most important reason I use it is because it handles nested tags. So let's say you have a <span> inside a <span>: Code:
<span class="italics">This is <span class="emphasis">emphasis</span> and this should still be italics.</span> Search: <span class="italics">(.+?)</span> Replace: <i>\1</i> would lead to this: Code:
<i>This is <span class="emphasis">emphasis</i> and this should still be italics.</span> Code:
<i>This is <span class="emphasis">emphasis</span> and this should still be italics.</i> Quote:
![]() I know I wrote about that years ago... it's buried somewhere on MobileRead... lol. Some of the popups tell you exact filenames, but many just say there's a "not well-formed XHTML file" but don't tell you exactly where. For now, a workaround I do is run Doitsu's "EPUBCheck" plugin. This points out exact filename + usually gives you a more accurate picture: You can also double-click to jump to the location in the file. Quote:
Like an easy "press this as a final step". Quote:
And the optional checkboxes are key. Maybe even in the popup window, it lists all the steps + adds:
so IF Sigil is doing something weird/unexpected during the publishing step, they'll know someplace to look. ![]() Many times, you'd do manual adjustments. (Either the look of the HTML or the content.opf itself.) Like some publishers still stupidly insist on adding front/backmatter to the TOC. Something like this might bring more frustration. (But again, checkbox solves that! Now... to have it on or off by default... ![]() Which reminds me of another extremely minor niggle (although I haven't tested on the latest Sigil versions). Let's say you have this XHTML. It's already nice and prettified: Code:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <p>This is an example.</p> </body> </html> Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="../Styles/stylesheet.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<p>This is an example.</p>
</body>
</html>
I think a similar thing happens with Tools > Table Of Contents > Create Table of Contents + Tools > Add Cover. Maybe these buttons should insert nice, prettified code by default. ![]() Last edited by Tex2002ans; 03-06-2021 at 02:09 PM. |
||||||
![]() |
![]() |
![]() |
#171 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 808
Karma: 2416112
Join Date: Jan 2017
Location: Poland
Device: Various
|
I really understand the importance of the problem and the enormous difficulty of implementing a solution that doesn't destroy the code if it doesn't work properly. On the other hand, isn't every misuse of regular expressions during Find & Replace risky? Many times I have spoiled many hours of work by accidental replace. Fortunately, now there are checkpoints (although you have to remember about them), but before that it was even more dangerous.
Absolutely not complaining about the existing F&R solution. I can always write a plugin that will do what I need to replace in a more "smart" way. But sometimes you need something ad hoc F&R and then I miss this possibility inside Sigil. Saving search parameters will be a wonderful addition, because in one group of searches you will be able to combine changes with different parameters. I also didn't want to impose priorities, I only expressed my opinion. |
![]() |
![]() |
![]() |
#172 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
@BeckyEbook,
Understood. I just wanted to know your opinion of the big green button idea on its own merits and not worrying about saved searches or search outside tags at all. In other words ... Is it worthwhile at some point or not? Last edited by KevinH; 03-06-2021 at 03:37 PM. |
![]() |
![]() |
![]() |
#173 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 808
Karma: 2416112
Join Date: Jan 2017
Location: Poland
Device: Various
|
Probably yes, if this mechanism was made in the form of a wizard, where after each step the user would receive feedback on the actions performed. Of course, being able to turn stages on/off is crucial.
But isn't that a major change by any chance? ![]() |
![]() |
![]() |
![]() |
#174 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Actually, it is just calling a sequence of existing plugins and existing internal routines with a pop-up to show results and its own gui tab in Preferences. It would auto stop at the first failure.
It is not something for Sigil 1.5.0 or even 1.6.0 but could come in the next couple of releases after that if people felt it would be a big help. I am hoping to get the saved searches into Sigil 1.6. The Sigil 1.5 changes are already in place in master and pretty much done. Once the user-guide is done and the translation teams have had their shot, we will put out a Sigil-1.5.0 Beta to be quickly followed by a final release if not many bugs are reported in the beta. At least that is the plan now. I have been pounding on Sigil master hard and have found and fixed a handful of issues but things seem to be working well as of now. Take care, Kevin |
![]() |
![]() |
![]() |
#175 |
Hedge Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
I would certainly find "a big green button" feature very useful.
|
![]() |
![]() |
![]() |
#176 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 814
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Touch HD, Future features or dead features? | ElWorm | PocketBook | 4 | 02-07-2018 11:36 AM |
New Plugin Features in the upcoming Sigil 0.8.900 | KevinH | Plugins | 6 | 09-14-2015 02:48 PM |
FAQ>How do I use ... features of the conversion tools? | chaot | Library Management | 2 | 08-28-2012 07:28 AM |
Writer2ePub, Sigil, and mjBookMaker Features | Ransom | Writer2ePub | 1 | 09-21-2011 09:20 AM |
ePub Creation Tools: Sigil vs Oxygen | twedigteam | ePub | 6 | 12-10-2010 03:41 AM |