Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-06-2021, 09:13 AM   #166
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,647
Karma: 5433388
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
KevinH is offline   Reply With Quote
Old 03-06-2021, 11:16 AM   #167
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
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
BeckyEbook is offline   Reply With Quote
Advert
Old 03-06-2021, 12:29 PM   #168
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,647
Karma: 5433388
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!
KevinH is offline   Reply With Quote
Old 03-06-2021, 01:16 PM   #169
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,647
Karma: 5433388
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(?=[^>]*<)
This basically says search for "title" but lookahead to make sure there are no closing tag chars ">" before you find the next opening tag char "<".

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 &lt; and &gt; 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.
KevinH is offline   Reply With Quote
Old 03-06-2021, 02:05 PM   #170
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Tex2002ans View Post
Note: Notepad++'s "Find All" displays in a chronological list form, although it displays the entire line. When working with long paragraphs, many times the hit is going to display off screen:
In Notepad++, after pressing Find All:

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:
Originally Posted by Tex2002ans View Post
Wow @Tex2002ans! I'm impressed by all the information on your post.


Quote:
Originally Posted by Coleccionista View Post
Certainly I'm going to add TagMechanic to my plugins in Sigil and let's see if future versions can advance in this area.
It's an essential plugin.

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>
Trying to replace the outer <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>
TagMechanic actually parses the HTML tree, so it knows what opening/closing tags belong together.

Code:
<i>This is <span class="emphasis">emphasis</span> and this should still be italics.</i>
Quote:
Originally Posted by Coleccionista View Post
One of the things I would also love is if when Sigil can't save the book from HTML errors (missing < or > or a tag, etc) it would give you more information. The popup dialog doesn't identify the wrong file and right now I have to turn live preview and check all recently modified files to get the warning error in LP with the line number (when lucky).


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:

Click image for larger version

Name:	Sigil.EPUBCheck.-.File.Line.Errors.png
Views:	140
Size:	10.0 KB
ID:	185762

You can also double-click to jump to the location in the file.

Quote:
Originally Posted by KevinH View Post
Does Sigil, sometime in the future, need something like a big green "Publish" button that would:
Hmmmm... this does sound like a user-friendly enhancement.

Like an easy "press this as a final step".

Quote:
Originally Posted by KevinH View Post
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.
Agree with this.

And the optional checkboxes are key.

Maybe even in the popup window, it lists all the steps + adds:
  • = successfully completed
  • — = steps that weren't applied
  • = failed

so IF Sigil is doing something weird/unexpected during the publishing step, they'll know someplace to look.

Quote:
Originally Posted by KevinH View Post
- regenerate the Nav, and any html TOC
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... .)

Quote:
Originally Posted by KevinH View Post
- automatically run Mend and Prettify on all code
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>
Right-Click + Link Stylesheets:

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>
Then you have to prettify all over again. :P

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.
Tex2002ans is offline   Reply With Quote
Advert
Old 03-06-2021, 02:12 PM   #171
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
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.
BeckyEbook is offline   Reply With Quote
Old 03-06-2021, 03:33 PM   #172
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,647
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Old 03-06-2021, 03:43 PM   #173
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Quote:
Originally Posted by KevinH View Post
In other words ... Is it worthwhile at some point or not?
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?
BeckyEbook is offline   Reply With Quote
Old 03-06-2021, 03:56 PM   #174
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,647
Karma: 5433388
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


Quote:
Originally Posted by BeckyEbook View Post
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?
KevinH is offline   Reply With Quote
Old 03-06-2021, 07:29 PM   #175
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by BeckyEbook View Post
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.
I would certainly find "a big green button" feature very useful.
Thasaidon is offline   Reply With Quote
Old 03-06-2021, 09:11 PM   #176
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 769
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Quote:
Originally Posted by Thasaidon View Post
I would certainly find "a big green button" feature very useful.
Ditto. Thank you.
icallaci is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


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


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