Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 07-09-2018, 09:31 PM   #31
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: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Hi

Needed to use the plugin a couple of times yesterday. Works like a charm and saved me a lot of time over using Regex and manually amending files.

Thank you again for the plugin.
Thasaidon is offline   Reply With Quote
Old 07-09-2018, 10:42 PM   #32
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@BeckyEBook...

prefs['add_chapter_template'] = 'Chapter'

In the plugin, the Add heading name template textbox is initially initialized to 'Chapter' in the dialog itself and is re-populated later if there is an appropriate existing value in prefs. After the OK button is pressed the user-entered dialog value is then saved to prefs. The main reason I initialize this option to either 'Chapter' for file group selections or 'Preface' for single file selections is to give the plugin user a helpful indication of what should be put into the textbox. Perhaps I should've initialized it to "e.g. Chapter" or "e.g. Preface" but I think that looks a bit ugly.

Quote:
2. Ignore template if "Use numbered headings only" is enabled
(Perhaps I do not understand this option, but if ... numbered ... only – ignoring is a good idea.)
File: cutils.py (approx. 250 line, before the first use of SUFFIX_CHOICE).

Code:
Code:
                if options.NUM_HEADINGS_CHOICE  == 'Yes':
                    options.SUFFIX_CHOICE = ''
There are two similar python functions found in cutils.py in the plugin code that you can have a look at. One is called AddSelectedHeading()(handler for single file selections) and the other is called AddSelectedHeadings()(handler for multi-file group selections). Both these functions basically build the new heading text line on the fly according to dialog user inputs and then it just inserts the heading line at the top of the file(after the body tag).

When Use numbered headings only is selected, the numbering part of the heading is normally generated and added separately to the heading line from a straightforward ascending count(according to the selected file count) and then styled accordingly. And in the code in AddSelectedHeadings(), the new heading line is progressively built and, in the numbered-headings-only handler, you'll see that the heading text name is removed before the numbered heading line is rebuilt -- so the heading name is removed anyway. And don't forget that the Use numbered heading ony option also works together with the Select chapter number style option to determine what numbering style is used for numbered headings only. If you have a look at that function I've mentioned, that should more clearly help your understanding of how numbered headings are added and progressively formatted and styled.

Last edited by slowsmile; 07-10-2018 at 12:22 AM.
slowsmile is offline   Reply With Quote
Advert
Old 07-09-2018, 11:20 PM   #33
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@Thasaidon...Your most welcome and I'm glad that you find the plugin useful. To be honest with you, my greatest fear with this plugin was that it might be too complicated to use. I'm happy that this does not appear to be the case. Also, I doubt if I will add any more major functional updates to this plugin. I think it's reached its limit in terms of maintaining easy plugin usage.

Last edited by slowsmile; 07-09-2018 at 11:24 PM.
slowsmile is offline   Reply With Quote
Old 07-10-2018, 01:23 AM   #34
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Plugin Update: The new maximum number of chapters allowed when using the Number as Text or Roman Numerals dialog options has been increased to 100.

Last edited by slowsmile; 07-10-2018 at 01:34 AM.
slowsmile is offline   Reply With Quote
Old 07-10-2018, 03:47 AM   #35
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: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
slowsmile
Quote:
Originally Posted by slowsmile View Post

Ad prefs['add_chapter_template'] = 'Chapter'

In the plugin, the Add heading name template textbox is initially initialized to 'Chapter' in the dialog itself and is re-populated later if there is an appropriate existing value in prefs. After the OK button is pressed the user-entered dialog value is then saved to prefs. The main reason I initialize this option to either 'Chapter' for file group selections or 'Preface' for single file selections is to give the plugin user a helpful indication of what should be put into the textbox. Perhaps I should've initialized it to "e.g. Chapter" or "e.g. Preface" but I think that looks a bit ugly.
I understand your idea.
But think about users from other countries who prefer to have instead of "Chapter" e.g. "Kapitel", "Rozdział" or "Глава".
My suggestion SAVES the typed word in Template input box when selecting multiple files, and "Preface" is used when selecting only one file.


Ad "cleaning" options.SUFFIX_CHOICE.

You're right, but not quite.
For template "Chapter" all works.
Change template to other word (write something else there).
Then the word from the template is added, despite choosing "Use numbered headings only".

Code:
<h1>Blahblahblah ONE</h1>
Attached Thumbnails
Click image for larger version

Name:	rework-issue.png
Views:	433
Size:	14.7 KB
ID:	164973  
BeckyEbook is offline   Reply With Quote
Advert
Old 07-10-2018, 06:29 AM   #36
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@BeckyeBook...OK I think I understand what you're saying. What I think you want is for the last text typed into the Add heading name template textbox to always be saved and displayed again on the next plugin run. I hope I've got that right.

I've already put a fix in for the above and I'm testing it now.

The fix will apply to header templates names for both file groups and single file processing by the plugin. In other words, whatever is typed into the header name template textbox will, in all instances, be preserved and displayed again whenever the plugin is next run.

Please also confirm that the above fix is what you want(and I've got the solution right).

Last edited by slowsmile; 07-10-2018 at 06:51 AM.
slowsmile is offline   Reply With Quote
Old 07-10-2018, 06:35 AM   #37
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: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
Quote:
Originally Posted by slowsmile View Post
OK I think understand what you're saying. What I think you want is for the last text typed into the Add heading name template textbox to always be saved and displayed again on the next plugin run. I hope I've got that right.
Exactly
In other languages, saving the template will speed up the work with the plugin.
BeckyEbook is offline   Reply With Quote
Old 07-10-2018, 07:02 AM   #38
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Thanks for that. I'll put out a new release soon.
slowsmile is offline   Reply With Quote
Old 07-10-2018, 07:54 AM   #39
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Plugin Update: The plugin has been changed in v0.1.8:

* In the dialog, the text typed into the Add heading name template textbox will now always be saved and dispalyed on the next plugin run.

* Fixed a problem in the version updater, which wasn't working.
slowsmile is offline   Reply With Quote
Old 07-10-2018, 08:07 AM   #40
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: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
[QUOTE=slowsmile;3720202]Plugin Update: The plugin has been changed in v0.1.8[QUOTE]
Template is saved. Thank you.

And second issue/suggestion?

1. Select some files (x)html.
2. Run plugin.
3. Remove headings in Step 1.
4. Set template to any word other than "Chapter" in Step 2
AND
Select "Use numbered headings only" to "Yes".

Expected: 1, one, I

…but result is: Word* 1, Word* one, Word* I

* "Word" = heading name template

Last edited by BeckyEbook; 07-10-2018 at 08:09 AM.
BeckyEbook is offline   Reply With Quote
Old 07-10-2018, 08:24 AM   #41
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@BeckyEbook

Quote:
And second issue/suggestion?

1. Select some files (x)html.
2. Run plugin.
3. Remove Headers in Step 1.
4. Set template to any word other than "Chapter" in Step 2
AND
Select "Use numbered headings only" to "Yes".

Expected: 1, one, I
But the plugin can already do the above. And why would you want to write or select any chapter text when all you're doing is generating numbered headings(without any alpha text)???

Try this:

1. Select your file group.

2.Remove/Add the heading style

(ignore the Add heading name template textbox -- it isn't used)

3. Now set Select heading number style to Numeric String, Number as Text or Roman Numerals.

4. Then set the Use numbered headings option to 'Yes' and click OK.

Result: 1, ONE or I (I've also just tested this in Sigil with an epub)
(if Number as text is chosen then the text number will always be displayed in upper case for the Use numbered headings option only)

...And if you want headings like Word 1, Word One or Word I then don't select the numbered heading option because the numbering is separately and consecutively generated anyway by default for all selected headings using group selection only.

To change your file group headings to Word I, Word II, Word III do the following:

1. Select your file group.

2. Remove/Add the heading style

3. Use add heading name and add "Word"

4. Set number style option to Roman Numerals

5. Ensure numbered heading only option is set to 'No'

6. Click OK.


To change your file group headings to Word ONE, Word TWO, Word THREE do the following:

1. Select your file group.

2.Remove/Add the heading style

3. Use add heading name and add "Word"

4. Set the number style option to Number as Text

5. Set the number case option to uppercase

6. Ensure numbered heading only option is set to 'No'

7. Click OK.

Last edited by slowsmile; 07-10-2018 at 10:46 AM.
slowsmile is offline   Reply With Quote
Old 07-10-2018, 10:56 AM   #42
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: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
I understand everything perfectly.

But ... If I have completed the template field ("Word") AND selected numbered only for "Yes", the plugin should ignore the template.
Because now it requires both – deleting the template and enabling the "numbered heading only" option.

And my suggestion:
Code:
if options.NUM_HEADINGS_CHOICE  == 'Yes':
    options.SUFFIX_CHOICE = ''
solved it (temporary ignore template for enabled "numbered heading only").
Another gain is that preferences for "add_chapter_template" is not changed.
BeckyEbook is offline   Reply With Quote
Old 07-10-2018, 06:38 PM   #43
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@BeckyEBook...

Quote:
I understand everything perfectly.

But ... If I have completed the template field ("Word") AND selected numbered only for "Yes", the plugin should ignore the template.
Because now it requires both – deleting the template and enabling the "numbered heading only" option.

And my suggestion:
Code:
if options.NUM_HEADINGS_CHOICE == 'Yes':
options.SUFFIX_CHOICE = ''
solved it (temporary ignore template for enabled "numbered heading only").
Another gain is that preferences for "add_chapter_template" is not changed.
My apologies to you, you were right. I was able to duplicate the above problem. I'll put out a fix shortly. Thanks again for spotting this problem and providing the fix.

Last edited by slowsmile; 07-10-2018 at 06:40 PM.
slowsmile is offline   Reply With Quote
Old 07-10-2018, 07:06 PM   #44
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Plugin Update: Fixed a bug concerning the Add numbered heading only option where the chapter heading text was also being wrongly displayed with the chapter number(v0.1.9).

Last edited by slowsmile; 07-11-2018 at 04:37 AM.
slowsmile is offline   Reply With Quote
Old 07-11-2018, 07:50 AM   #45
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: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Hi @slowsmile

I upgraded from v0.12 to v 0,16 and hit the window size problem again and cannot access the 'OK' button. I cannot make the window any larger.

So I reverted to to v0.12 which does most of what I want. I have used it again four times today, which is far more than I expected but that may be just a flike due to the 25 books I selected to process. So the plugin is being used by me at least.

If you get time could you have a look a look at it, but no rush as I can use v0.12 .
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	400
Size:	111.4 KB
ID:	164984   Click image for larger version

Name:	Clipboard02.jpg
Views:	395
Size:	108.9 KB
ID:	164985  
Thasaidon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Chapter seperators (lines underneath chapter headings) indieauthor83 Sigil 9 06-23-2017 07:01 AM
Invisible chapter headings? bcamp47 Sigil 6 03-24-2013 01:38 AM
How to mark chapter headings JimLL Sigil 107 06-17-2012 10:02 AM
Chapter Headings Paxman53 Conversion 3 10-12-2011 01:31 PM
Why H1 and H2 Chapter Headings? Ransom Calibre 11 08-10-2011 05:29 PM


All times are GMT -4. The time now is 02:47 AM.


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