Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 07-16-2021, 06:08 PM   #16
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
@AlanHK...

Quote:
However, simply deleting lower level headings in the TOC is not good. If it doesn't combine them it should leave them. Now it erases all subheads within a chapter.
Deleting what from where? Deleting subheads from the NCX TOC or deleting subheads from within the xhtml files? I tested the plugin with a test file which used h1, h2 plus a third heading(formatted with h3) and there were no problems or deletions in the NCX or epub html. I also tested my plugin using a much larger and more complicated epub file that also used 3 heading levels -- including subheadings. The plugin didn't have a problem with either test file and there were no subheading deletions. Of course if you don't format the appropriate headings using just h1 and h2 styling then you will probably get problems. But that's all explained in the plugin release notes which I'm sure you've read already.

Quote:
And configurable separator character would be nice.
When you say configurable separator character do you mean being able to configure different font characters/symbols with different font sizes etc? That's not really necessary since you can easily reconfigure/restyle those separator characters manually anyway after you run the plugin. I always prefer to keep plugins simple -- and if you want to do something more exotic you can usually achieve those changes manually in the CSS or you can do it using grep S&R.

Last edited by slowsmile; 07-16-2021 at 11:54 PM.
slowsmile is offline   Reply With Quote
Old 07-23-2021, 03:53 AM   #17
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by slowsmile View Post
Deleting what from where?
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>
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.



Quote:
Originally Posted by slowsmile View Post
When you say configurable separator character do you mean being able to configure different font characters/symbols with different font sizes etc?
The character.
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 06:52 AM.
AlanHK is offline   Reply With Quote
Advert
Old 07-23-2021, 09:11 PM   #18
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
@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 10:42 PM.
slowsmile is offline   Reply With Quote
Old 08-17-2021, 02:43 AM   #19
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by slowsmile View Post
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.
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 more than two levels of headings, you can't use this plugin.

Quote:
Originally Posted by slowsmile View Post
"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.
Not when I tried this.
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>&lt;i&gt;TIME AND THE GODS&lt;/i&gt;</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.
AlanHK is offline   Reply With Quote
Old 08-20-2021, 10:32 PM   #20
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
@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>&lt;i&gt;TIME AND THE GODS&lt;/i&gt;</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-20-2021 at 11:23 PM.
slowsmile is offline   Reply With Quote
Advert
Old 08-23-2021, 02:53 AM   #21
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by slowsmile View Post
Why on earth would you ever expect Sigil's "Create HTML TOC" feature to allow you to format the text within the NCX TOC.
I didn't. Was pretty sure it would not work but you said

Quote:
Originally Posted by slowsmile
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,
So presumably you meant "add the text of the h1, h2 headings", not the h1, h2 heading tags.
AlanHK is offline   Reply With Quote
Old 08-25-2021, 04:39 AM   #22
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
@AlanHK
Quote:
"So presumably you meant "add the text of the h1, h2 headings", not the h1, h2 heading tags. "
In Sigil, if you open either the Tools > Table of Contents > Create TOC pop-up window then, if you want to capitalize, change text or add text to the displayed headings then all you have to do is just double click on any selected heading on the left and you can directly edit the text how you like. You can do that to all displayed headings but, as I've already mentioned, you cannot add html to those changes because it only allows text edits, not edits using html mark-up.

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 04:53 AM.
slowsmile is offline   Reply With Quote
Old 08-27-2021, 01:31 AM   #23
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by slowsmile View Post
@AlanHK
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 01:33 AM.
AlanHK is offline   Reply With Quote
Old 08-30-2021, 10:17 PM   #24
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
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 03:19 AM.
slowsmile is offline   Reply With Quote
Old 02-02-2023, 01:19 PM   #25
Tasikaa
Junior Member
Tasikaa began at the beginning.
 
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
Tasikaa is offline   Reply With Quote
Old 02-02-2023, 01:35 PM   #26
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
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 11:31 AM.
DiapDealer is offline   Reply With Quote
Old 02-03-2023, 10:21 AM   #27
Tasikaa
Junior Member
Tasikaa began at the beginning.
 
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.
Tasikaa is offline   Reply With Quote
Old 02-05-2023, 11:02 PM   #28
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
Update(v0.1.3)
  1. Fixed 'import sys' problem(thanks to @DiapDealer.).
  2. Removed non-related and unnecessary README.txt file from plugin directory(thanks to @BeckyEBook).

Last edited by slowsmile; 02-05-2023 at 11:05 PM.
slowsmile is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[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
Problem with my ScrambleEbook plugin and the Plugin Updater tool jackie_w Development 14 01-19-2017 10:49 PM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM


All times are GMT -4. The time now is 06:32 PM.


MobileRead.com is a privately owned, operated and funded community.