LogicalTOCStyler
A Sigil Plugin
Changes the styling of the Logical TOC(Device TOC)
Requirements
Plugin Type: Edit
MIT(OSI) Licence
Minimum Sigil requirement: v0.9.3 or higher
Python Requirements: Python 3.4+ (Bundled or External)
OS Requirements: Windows, Linux or OSX
Current Version: "0.1.1"
*** Tested on Windows 7, 8 & 10 only ***
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 LogicalTOCStyler _vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run the plugin by selecting Plugins > Edit > LogicalTOCStyler
Description
This plugin allows the user to safely re-style the Logical TOC in titlecase/uppercase without the user going near the toc.ncx file. This simple plugin just reformats the Logical TOC according to the preferences of the plugin user.
User Options(via dialog)
*Convert all headings to titlecase
*Convert all headings to uppercase
*Convert only chapter headings to uppercase
*Converts only user-defined headings to uppercase (set in plugin prefs -- see Using Preferences)
Default prefs reset
This checkbutton resets the user-defined heading list back to the original default list.
Using Preferences
user_defined_heading_list
You can define and set your own user-defined Logical TOC heading style prefs in Sigil by going to Plugins > Manage Plugins > Open Preferences Location > plugin_prefs > LogicalTOCStyler > LogicalTOCStyler .json. The default user-defined settings in the json file are shown below:
user_defined_heading_list: ["preface", "introduction", "foreword", "epigraph", "prologue", "chapter", "epilogue", "Index"]
The user can add or remove headings to and from this search list as preferred. Additional headings should always be added in lowercase. If any of the above headings in the heading list are found in your Logical TOC then they will be formatted in uppercase. Any headings not included in the search list will all be formatted in titlecase.
titlecase_exclude_list
There is also another list defined in plugin prefs which is shown below:
"titlecase_exclude_list": ["the", "a", "an", "at", "to", "is", "are", "and", "on", "by", "for", "in", "on", "from"]
If any of the words in the above list are found in a titlecase-only heading then they will be converted to lowercase. Users can also add or remove words to and from this list as preferred to create their own "proper" titlecase headings.(Added in v0.1.1)
Plugin Run
First load your epub into Sigil and then just run this plugin. After running this plugin you can then easily check the new heading format in the toc.ncx file using html view.