02-06-2023, 02:46 AM | #1 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
[Plugin] GenerateHeadings
Automatically generates main headings in the epub 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, Linux or OSX *** Tested on Windows 7, 8 & 10 only *** Current Version: "0.1.1" Installation * Select Manage Plugins from the Plugins menu. In the dialog box, select either the Bundled Python or the External Python(Python 3.8+ should be installed on your computer to run this plugin externally). * Click Add Plugin and select GenerateHeadings_vXXX.zip. This will load and install the plugin into Sigil, which you can then run by selecting Plugins > Edit > GenerateHeadings. Description I wrote this plugin through frustration because it is still very common, for example, when exporting epubs from apps like LibreOffice Writer, Kindle Create or Scrivener(old version), that create epubs with missing strings in the <title></title> tags and with all chapter headings incorrectly formatted using <p> tags. This plugin just does just three tasks:
Preferences Here are the editable JSON file entries for this plugin: { "heading_list": [ "chapter", "introduction", "preface", "prologue", "epilogue", "about the author", "other books" ], "heading_type": "h1", "title_page_marker": "~" } heading_list This editable list contains the search terms that will be used by this plugin when searching for your main/chapter headings in your epub. This list can be edited and changed by you to suit your own heading search preferences. By default, this list is currently setup to search for most of the standard headings currently used in books and ebooks. heading_type This allows the user to set eitther ‘h1’ or ‘h2’ as their chapter/main heading format. The default setting is ‘h1’. title_page_marker The plugin user can also use a marker of his own choice in order to add “title=Title Page” into the html formatting of the the main title in the title section. Just place the marker in front of the title string in the title page. The current default marker is a tilde or "~" and how to use it in the html is shown below: Code:
<p class="P1">~The Book Title</p>
Plugin Run After running the plugin once, check that the search words in the JSON file heading list are to your own personal liking and, if required, you can add or change the JSON settings as you like. Changes: Spoiler:
Last edited by slowsmile; 05-09-2023 at 02:51 AM. |
02-06-2023, 11:43 AM | #2 |
Sigil Developer
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Added to the Sigil Plugin Index
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] LOI-Generator - edit] plugin to generate a List of Illustrations | KevinH | Plugins | 1 | 01-19-2023 04:31 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) | mneimeyer | Plugins | 3 | 11-11-2019 08:07 PM |
[Plugin] QuickPrefsEdit - Edit plugin prefs json files. | slowsmile | Plugins | 3 | 07-25-2018 08:14 PM |
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) | www | KOReader | 4 | 09-28-2017 10:34 AM |