07-16-2021, 07:08 PM | #16 | ||
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@AlanHK...
Quote:
Quote:
Last edited by slowsmile; 07-17-2021 at 12:54 AM. |
||
07-23-2021, 04:53 AM | #17 | |
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
I had a toc with 3 levels of headings, as mentioned. Using the plugin combined level 1 and level 2, deleted level 3. Only affecting the ncx file, to clarify, the HTML files aren't affected.
This is the way the chapter headings were coded originally. Code:
<body class="content"> <div class="title-page-contributor-primary-block"> <div class="heading1"> <div class="heading-contents1"> <div class="title-page-contributor-primary-block"> <div class="element-number-block"> <h1>5</h1> </div> <div class="title-page-contributor-primary-block"> <h2>Jake</h2> </div> <h3>Day One</h3> </div> </div> </div> Then using the plugin combines h1 and h2 text in the TOC, and the h3 heads disappear. Quote:
I know there is no formatting in the NCX, at least no way I know of. The plugin offers space, em dash, en dash, tilde as separator. Many use period or colon, (Chapter 2: The Story Continues) but rather than add more and more symbols, etc., simplest just have a default and let user change it to whatever, preferably retained for next use. Last edited by AlanHK; 07-23-2021 at 07:52 AM. |
|
Advert | |
|
07-23-2021, 10:11 PM | #18 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@AlanHK...
"I had a toc with 3 levels of headings, as mentioned. Using the plugin combined level 1 and level 2, deleted level 3. Only affecting the ncx file, to clarify, the HTML files aren't affected." I draw the line at combining h1, h2 and h3 simply because I doubt many people will want to combine 3 headings per NCX heading. In other words your idea of combining 3 levels -- h1, h2 & h3 -- is unrealistic because I'm guessing that not many people will use it. More likely, they will prefer to combine just h1 & h2 headings in the NCX TOC. Add to this that such a plugin change -- to combine h1, separator, h2 & h3 -- would also make plugin usage more complicated. As I've already mentioned, I like to keep it simple for the user. "Using Sigil's generate TOC tool gives 3 levels of headings. Then using the plugin combines h1 and h2 text in the TOC, and the h3 heads disappear." What you describe above is correct behaviour for the plugin because the plugin is only meant to combine just the h1 & h2 headings in the NCX TOC. The plugin does not combine or add h3. In other words, only combining h1 and h2 headings is what the plugin is supposed to do as is clearly stated in the plugin release notes -- it's certainly not a plugin error as you seem to be inferring. "I know there is no formatting in the NCX, at least no way I know of." Actually you can both generate and edit/change the headings in the NCX TOC quite easily in Sigil. Just click on Tools > Table of Contents > Generate Table of Contents or Edit Table of Contents and then right-click and edit each heading as you like. In this way you can edit/change each NCX heading in turn by manually typing in and adding h1, h2 headings with a separator and even, if you like, adding h3 headings appropriately to each NCX heading. And when your done, just press OK and your epub's NCX TOC will automatically update to your new NCX TOC heading format. And you could probably also use grep S&R within the toc.ncx file to achieve the same outcome or result. Last edited by slowsmile; 07-23-2021 at 11:42 PM. |
08-17-2021, 03:43 AM | #19 | ||
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
That is damaging the book. If you more than two levels of headings, you can't use this plugin. Quote:
Any codes you type into the the TOC editor get encoded and you just get visible code, not changes on format. e,g, adding <i> </i> to a heading, what I see is the literal codes and looking in the NCX what it did was <text><i>TIME AND THE GODS</i></text> If I edit the NCX to make it <text><i>TIME AND THE GODS</i></text> and then do "Create HTML TOC", the tags were not there. And epubcheck says ERROR(RSC-005): Error while parsing file 'element "i" not allowed anywhere; expected the element end-tag or text'. Anyway, not asking to insert any formatting into the NCX. I leave that to the HTML TOC. Just a choice of separator character. |
||
08-20-2021, 11:32 PM | #20 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@AlanHK...
"The error is not that it doesn't combine h1+h2+h3 but that it combines h1+h2 and DELETES h3. That is damaging the book. If you add more than two levels of headings, you can't use this plugin." I'll have another look at that problem. "<text><i>TIME AND THE GODS</i></text> If I edit the NCX to make it <text><i>TIME AND THE GODS</i></text> and then do "Create HTML TOC", the tags were not there. And epubcheck says: ERROR(RSC-005): Error while parsing file 'element "i" not allowed anywhere; expected the element end-tag or text'. " Why on earth would you ever expect Sigil's "Create HTML TOC" feature to allow you to format the text within the NCX TOC in the editor or directly within the toc.ncx file itself? Heck, the Create HTML TOC editor is a pure text editor for goodness sake -- it's not an html editor that will allow you to embed html code tags. Also, the toc.ncx file isn't an html file -- it's an XML file. You could perhaps add indents and alter the chapter headings to upper/lower/title case within the Create HTML TOC editor or within the toc.ncx file but that's about all you can do. Last edited by slowsmile; 08-21-2021 at 12:23 AM. |
Advert | |
|
08-23-2021, 03:53 AM | #21 | ||
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
Quote:
|
||
08-25-2021, 05:39 AM | #22 | |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@AlanHK
Quote:
And I'm not sure whether you actually realize it but, due to a fairly recent Sigil change, you now have two ways to specifically edit the NCX TOC in Sigil. You can edit the TOC in the normal way using Tools > Table of Contents > Generate TOC and when you press "OK" this feature always creates an NCX TOC from scratch. But you can also now directly edit the existing NCX TOC(in the toc.ncx) by just clicking on Tools > Table of Contents > Edit TOC. And again this feature also allows you to directly change/edit heading text only(not html) and add indents. And when you click "OK" it automatically updates all your heading changes in the toc.ncx file. Last edited by slowsmile; 08-25-2021 at 05:53 AM. |
|
08-27-2021, 02:31 AM | #23 |
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Sure. I knew all that. Don't know why you thought I didn't.
I've been using "Edit TOC" and also directly editing the NCX for years. We just seem to be not communicating well. Last edited by AlanHK; 08-27-2021 at 02:33 AM. |
08-30-2021, 11:17 PM | #24 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update(v0.1.2):
Fixed a problem with sub-headings h3 - h6 not displaying in the TOC NCX after running the plugin. Thanks to AlanHK. This plugin will now create a flat NCX TOC showing all headings formatted with h1 - h6. 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. Last edited by slowsmile; 09-01-2021 at 04:19 AM. |
02-02-2023, 02:19 PM | #25 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2023
Device: Samsung A70
|
Hey! I have a problem when using this with Sigil 1.9.20 on Windows 10.
Status: failed Traceback (most recent call last): File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 141, in launch target_script = __import__(script_module) File "C:\Users\Tasikaa\AppData\Local\sigil-ebook\sigil\plugins\CombineNCXHeadings\plugin.py", line 36, in <module> from dialog import * File "C:\Users\Tasikaa\AppData\Local\sigil-ebook\sigil\plugins\CombineNCXHeadings\dialog.py", line 18, in <module> if sys.platform == 'linux' or \ NameError: name 'sys' is not defined Error: name 'sys' is not defined |
02-02-2023, 02:35 PM | #26 |
Grand Sorcerer
Posts: 28,042
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
There's something wrong with the plugin file attached to post #1. Adding the missing 'import sys' statement early in dialog.py seems to fix things though. 300+ downloads and this is the first someone has complained?!
Last edited by DiapDealer; 02-03-2023 at 12:31 PM. |
02-03-2023, 11:21 AM | #27 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2023
Device: Samsung A70
|
Yeah, I did what @DiapDealer said and it works now. OP should probably put this fix into the download.
|
02-06-2023, 12:02 AM | #28 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update(v0.1.3)
Last edited by slowsmile; 02-06-2023 at 12:05 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) | mneimeyer | Plugins | 3 | 11-11-2019 09:07 PM |
[Plugin] QuickPrefsEdit - Edit plugin prefs json files. | slowsmile | Plugins | 3 | 07-25-2018 09:14 PM |
Goodread Perception Expander plugin not shown on plugin list (kobo h2o) | www | KOReader | 4 | 09-28-2017 11:34 AM |
Problem with my ScrambleEbook plugin and the Plugin Updater tool | jackie_w | Development | 14 | 01-19-2017 11:49 PM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 03:24 AM |