View Single Post
Old 07-13-2020, 12:28 AM   #1
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] CombineNCXHeadings

Combines the chapter titles and chapter subtitles into single headings in the NCX TOC

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 10, OSX and Linux ***
Current Version: "0.1.3"

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 CombineNCXHeadings_vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run using Plugins > Edit > CombineNCXHeadings.

Description
This plugin combines the chapter title headings(as h1) and chapter subtitle headings(as h2) from the html files into single headings in the NCX TOC. The plugin user will also be able to:
  • Separately and individually style the word case of the chapter title and chapter subtitle parts of the combined headings in the NCX TOC.
  • Add a separator of your choice between the chapter title and chapter subtitle parts of the combined NCX TOC headings.
  • Lone chapter title headings(with no chapter subtitles) will also be styled in the user's chosen word case style.
  • This plugin will only create a single level NCX TOC.
For title case only, the plugin user can also more tightly control the title case output by adding the appropriate words to the ignore_titlecase variable in the plugin's associated JSON file. All words in the JSON string will automatically be excluded from title case conversion and will be displayed in lower case instead.

Updates:
This plugin will now create a flat NCX TOC showing all sub-headings formatted with h3 - h6 (Fixed in v0.1.2).If you wish to add indents to your sub-heading entries in your NCX TOC, you can do this in Sigil using Tools > Edit Table of Contents in the normal way by selecting each of the relevant headings in turn and using the Arrow Keys on your keyboard to directly add/remove indents in the edit window as you prefer.

Changes:
Spoiler:
v0.1.3 -- Fixed 'import sys' problem(thanks to @DiapDealer).
v0.1.3 -- Removed non-related README.txt file from plugin directory(thanks to @BeckyEBook).
v0.1.2 -- Fixed a problem where, after running the plugin, any h3 - h6 sub-headings were not displayed in the NCX TOC. See Update section for more details. Thanks to AlanHK
v0.1.1 -- Removed README file and added MIT License file. Thanks to Ambaquista.
v0.1.0 -- Initial release
Attached Files
File Type: zip CombineNCXHeadings_v013.zip (20.3 KB, 475 views)

Last edited by slowsmile; 02-08-2023 at 05:27 AM.
slowsmile is offline   Reply With Quote