Automatically replaces or adds selected file headings or a single selected file heading in multiple user-defined  formats and styles

Requirements
Plugin Type: Edit
MIT Licence(OSI)
Minimum Sigil requirement: v0.9.3 or higher
Python Requirements: Python 3.4+ (Bundled or External)
OS Requirements: Windows, OSX or Linux
*** Tested on Windows 7, 8 & 10, OSX and Linux ***
Current Version: "0.1.6"

Installation
* Select Manage Plugins from the Plugins menu. In the dialog box, select either the Bundled Python or the External Python(Python 3.4+ should be installed on your computer to run this plugin externally).

* Click Add Plugin and select ReworkChapterHeads_vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run using Plugins > Edit > ReworkChapterHeads

Description
This edit plugin allows the user to add or replace and separately reformat the 'chapter' header part and the chapter number part of the heading in any style they prefer i.e. numeric string(chapter 1, Chapter 10, CHAPTER 23 etc), number as text(chapter one , Chapter Fifteen or CHAPTER THIRTY-FIVE) or roman numerals(chapter II, Chapter XXIX, CHAPTER XXXIV). The plugin can now also similarly modify a single selected heading file in the same way(added in v0.1.6). This plugin tries to provide an easy and quick way of replacing or adding either multi-file headings or a single file heading in your epub that will be formatted according to the user's own individual preferences.

This plugin automatically inserts all selected file group types consecutively in various user-defined formats and styles using normal file selection from Sigil's Book Browser(See Plugin Run for details).

User Options 1 -- Remove heading(s) (via dialog)

* Remove heading(s) formatted with...
This option allows the user to initially select and remove all selected heading lines in the epub or a single selected single heading line that is formatted in h1 to h6 heading style. If the Remove button is pressed the appropriate heading lines from the selected files will all be removed. But if the Skip button is pressed then this dialog will do nothing and the next dialog will show and the plugin will continue. So if you are replacing your heading(s) you should select the relevant heading style and use the Remove button but if you are adding new heading(s) then you should just use the Skip button(no headings will be removed). This remove/add feature is quite flexible and can also be used in other ways e.g. like removing the current h1 chapter headings in an epub and perhaps replacing them with formatted and styled h2 chapter headings.

User Options 2 -- Add new heading(s)(via dialog)

* Add heading name template
   This option allows the user to type and add the heading name part of the new heading into the textbox either in title case, lower case or upper case i.e. whatever you type into the textbox will be used as the main heading name throughout.

* Select heading style
  Now allows a choice of h1 to h6 heading style for all newly generated headings(changed in v0.1.6).

* Select chapter number style
  Allows the user to select the chapter or part numbering style e.g. numeric string, number as text or roman numerals.

* Select chapter number case
  This option only works if you have previously chosen Select chapter number style > Number as Text. Available user choices: titlecase, uppercase or lowercase. Chapter number as text case examples: one, Ten and TWENTY-THREE.

* Add classes to heading tag(s)
   The user just types a class name into the textbox for that class to be included in all the newly generated h1 or h2 chapter heading tags. Also make sure that the class has already been properly defined in the css. If you need to add more than one class per chapter heading, then just add in each class separated by a comma or a space.

* Use numbered headings only(added in v0.1.4)
   Allows the user to just use numbered headings for all chapter or part headings e.g. 1, 2, 3 or ONE, TWO, THREE or I, II, III. If Number as Text is selected, the text will always display in upper case whenever this option is selected.

* Hide heading(s)
  This feature is particularly useful if you are using jpeg images as chapter headings throughout your epub. By selecting and tagging the same pages containing these heading images using this plugin feature, these new chapter headings will remain invisible in Text View but they will still be present in HTML View, so this should help to make those chapter heading images both linkable and searchable in your epub.

Caveat
This plugin can now add, replace or modify both selected file groups as well as modify a single selected file(added in v0.1.6).

Plugin users should now be able to use use single file selection to modify any main heading file in the epub.

The maximum number of chapters allowed when using either Number as Text or Roman Numerals is 50. Otherwise you'll get overrun errors.

Depending on whether you use h1 to h6 heading styles, be sure that the chosen heading style for your heading is already properly defined by you in the css, otherwise the default heading style will be used. This plugin does not add or change styling in the css.

Plugin Run

* Using Ctl-Click and Shift-Click with your mouse, select either a single file or a multi-file group from Sigil's Book Browser.

* Then just run the plugin and the chapter heading(s) will automatically be replaced or added and formatted according to your dialog choices.

* Also bear in mind, for all chapter file group selections, that this plugin does not automatically update the epub TOC file or the Logical TOC(toc.ncx) to your new chapter heading style, so you should perhaps also run Create TOC and Generate TOC in Sigil to match up all ebook/device displays after running this plugin.