MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Adding a limited Automate Feature To Sigil (https://www.mobileread.com/forums/showthread.php?t=341347)

KevinH 08-04-2021 04:28 PM

A thread to collect and focus the conversation about the possibility of adding a limited automate feature to run a list of plugins plus some limited Main Window tools in sequence.

-- snip --

If it helps ... I am still thinking about adding a green publish button that will automate a number of user selected tasks that could/would include running Update Manifest Properties.

Either way is is just a single menu item or key shortcut so feel free to run it whenever you want, but forcing it to run anytime before the final save is just a waste.

phillipgessert 08-04-2021 05:41 PM

Quote:

Originally Posted by KevinH (Post 4144153)
If it helps ... I am still thinking about adding a green publish button that will automate a number of user selected tasks that could/would include running Update Manifest Properties.

Assuming I understand this correctly, I'd love this feature and the idea of it is pretty exciting.

KevinH 08-05-2021 12:36 PM

Quote:

Originally Posted by phillipgessert (Post 4144167)
Assuming I understand this correctly, I'd love this feature and the idea of it is pretty exciting.

I am thinking about adding a green "publish" button to the toolbar. A right click on it would open a dialog that allows a list of "activities" to be checked or unchecked (enabled or disabled).

When "publish" gets pushed, the checked "activities" will be run one by one stopping at the first failure with a Message Box allowing telling the user what failed.

My problem is what activities to include and it what order. This list would need to include plugins obviously so devs can write their own plugins or use others plugins as part of this process.

So some things for the list not in any particular order:

- run multi-language spellcheck dialog
- run basic well-formed check
- run Mend
- run Prettify
- update manifest properties
- validate stylesheets via w3c
- run epubcheck
- run flightcrew
- run a specific saved search list
- do a file save
- create a checkpoint
- run FolderOut
- open metadata editor
- generate NCX/Guide for epub2 only readers
- delete unused media
- delete unused css selectors
- generate reports
- run AccessAide to improve Accessibility
- run ePub3-itizer
- open current epub in ReadiumReader
- open current epub in EpubJSReader
- open current epub in BibiReader
- run other user plugin 1
- run other user plugin 2
- run other user plugin 3

So as you can see the list is already long and we would still need to add other things and then figure out how to allow the user to:

- specify the exact list they want to work with
- change the order of their activities
- add and remove activities

So a lot more thought and planning will need to go into this type of feature. I was hoping to add it for a Sigil 2.0 release so we still have time.

I would like people's thoughts on how best to handle all of this as simply as possible that still provides something useful.

If anyone has any thoughts they would like to share please do.

phillipgessert 08-05-2021 03:03 PM

Running a bunch of plugins in order alone would be pretty amazing. Automating that, maybe the TOC/metadata stuff + epubcheck and I personally would be happy as a clam. that list sounds awesome.

KevinH 08-05-2021 03:22 PM

Generically, it may be more useful to replace the big green "publish" button with a small "Automate" toolbar with lists of activities to automate.

Making a plugin call other plugins is probably doable but they would need to be of the same plugin type (edit vs input vs output vs validate) to keep the interface straight and get a result back into Sigil if needed.

There's a lot to consider as every activity including plugins would have to return a success or failure indicator of some sort.

It would be nice to somehow allow some of the C++ based Sigil tools be run from within a plugin, but that is very hard given our Sigil and current plugin design.

So we will be better off creating a C++ routine to run a user configurable list of activities that can include invoking plugins.

We just have to figure out the best way to do that and make it easy for people to configure and customize.

DNSB 08-05-2021 04:54 PM

Please! There is a string of actions I run when opening a epub and another string when I save an epub so a menu that allowed me an open and save option would be much appreciated.

jmurphy 08-05-2021 05:15 PM

WOW!

I've got a brutally simple workflow that I would love to see reduced to essentially a single click:

run kindleimport
Add cover (first)
MetaDataEditor - grab title for file-saveas
file-saveAs title
Reformat HTML - Mend and prettify all
move to main book file
S&R: <hr/> -> <hr class="sigil_split_marker" />
Split at Markers
edit styles.css: Prepend the following to the top:
h2 {page-break-before: always;}
p {text-indent: 1.5em; margin: 0; widows: 1; orphans: 1;}

Save

Lather, rinse, repeat

Hitch 08-05-2021 07:06 PM

Quote:

Originally Posted by KevinH (Post 4144343)
I am thinking about adding a green "publish" button to the toolbar. A right click on it would open a dialog that allows a list of "activities" to be checked or unchecked (enabled or disabled).

When "publish" gets pushed, the checked "activities" will be run one by one stopping at the first failure with a Message Box allowing telling the user what failed.

(snippage for space)

So a lot more thought and planning will need to go into this type of feature. I was hoping to add it for a Sigil 2.0 release so we still have time.

I would like people's thoughts on how best to handle all of this as simply as possible that still provides something useful.

If anyone has any thoughts they would like to share please do.

I would have to cogitate on this, but I love the simple idea of it. An uber-macro, effectively. (One Function to rule them all!)

Hitch

RbnJrg 08-05-2021 10:00 PM

Quote:

Originally Posted by KevinH (Post 4144343)
I am thinking about adding a green "publish" button to the toolbar. A right click on it would open a dialog that allows a list of "activities" to be checked or unchecked (enabled or disabled).

Impressive! I looking forward to that!

KevinH 08-10-2021 03:32 PM

Your idea of running a sequence of plugins in order seems to me to be a good starting point for any more advanced automated lists type project.

I will start playing around with a way to get a return value (true or false for success or failure) from a plugin so that we know to continue to the next plugin in the list or not. Plugins themselves already return a value but the plugin running codes does not pass it back.

Then as a proof of concept, a text file with a list of plugin names to run (one per line) could be read from a "automate01.txt" file stored in Sigil's Preferences folder.

We could perhaps start with support for 3 different "automate0X.txt" files so multiple lists exist simultaneously: one for open, one for save, and one for common editing for example.

We then add an Automation toolbar with 3 icons (each one dedicated to an automation list).

Would something this simple be of interest to others?


KevinH




Quote:

Originally Posted by phillipgessert (Post 4144380)
Running a bunch of plugins in order alone would be pretty amazing. Automating that, maybe the TOC/metadata stuff + epubcheck and I personally would be happy as a clam. that list sounds awesome.


Hitch 08-10-2021 05:15 PM

Quote:

Originally Posted by KevinH (Post 4145474)
Your idea of running a sequence of plugins in order seems to me to be a good starting point for any more advanced automated lists type project.

[snippage]

Would something this simple be of interest to others?


KevinH

Me!

Hitch

Binchen 08-11-2021 05:44 AM

#metoo

KevinH 08-11-2021 10:28 AM

One question ... a validation plugin can succeed but there could be errors detected.

How should this impact the automate list behaviour?

If a validation plugin in the list succeeds but returns errors, shouldn't the automation list stop?

If not, the next plugin in the list would continue and work on a known incorrect epub.

phillipgessert 08-11-2021 12:49 PM

Perhaps it should pause there for input (proceed/cancel)?

DiapDealer 08-11-2021 01:19 PM

I agree. I don't know how feasible it would be, but the ability to continue (ignore) or abort in the event of a validation error would be optimal, I think.


All times are GMT -4. The time now is 08:11 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.