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 09-28-2024, 01:10 PM   #541
PubFut
Junior Member
PubFut began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2024
Device: Sigil
Plugin code needs review/corrections

The python code in the attached plugin is based on input from Chat GPT (unfortunately I am not a developer myself). It needs review/corrections, as it does not process properly. Is there anyone willing to help me with this?

The plugin is supposed to create a table of contents in the <nav> section of every html file. This TOC shall include references/hyperlinks to all H1, H2 and H3 headings of the current page itself and all other pages that have the first 11 characters of the file name in common (this identifies these files as part of the same main chapter).

Any advise is very much appreciated.
Attached Files
File Type: zip TOC-nav.zip (1.9 KB, 37 views)
PubFut is offline   Reply With Quote
Old 09-28-2024, 02:10 PM   #542
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Just merge the html files so that one chapter is equivalent to one file. Let Sigil generate the nav using its tools.

What is the whole point for the tool you requested? What are you trying to achieve and why? If this is for generating epubs, it seems strange to merge a nav into every html file?

Last edited by KevinH; 09-28-2024 at 02:13 PM.
KevinH is offline   Reply With Quote
Old 09-28-2024, 02:55 PM   #543
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,372
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by KevinH View Post
What is the whole point for the tool you requested? What are you trying to achieve and why? If this is for generating epubs, it seems strange to merge a nav into every html file?
Looking at the poster's previous messages, they appear to want a mini-ToC at the start of each chapter file with the sections/subsections within the file listed. I've seen a similar layout in a textbook but there I found popping up the ToC was easier to use since I didn't need to go back to the start of chapter to find the mini-ToC. Looking at the internals of the ebook, it appeared that they generated the full ToC and then copy/pasted the ToC code for each chapter into the start of the chapter.

Chapter 42
Section 01
Subsection 01-01
Subsection 01-02
...
Section 02
Subsection 02-01
Subsection 02-02
...
DNSB is offline   Reply With Quote
Old 09-28-2024, 03:12 PM   #544
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,219
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
A pop-up ToC would definitely be more effective. Do all readers/devices support one now??

I wonder if the OP is simply trying to replicate old style web books with the last/first/next links??
Turtle91 is offline   Reply With Quote
Old 09-28-2024, 03:26 PM   #545
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,372
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Turtle91 View Post
A pop-up ToC would definitely be more effective. Do all readers/devices support one now??
All the newer devices and applications that I've seen support a popup ToC.

Quote:
Originally Posted by Turtle91 View Post
I wonder if the OP is simply trying to replicate old style web books with the last/first/next links??
That was what their original request sounded like. The mini-ToC was a later request. For me, neither request makes much sense. On my Kobo ereaders, I tap in the middle of the screen and can use the arrows on the position slider to jump forward/back chapters or hit the ToC to bring up the full ToC. The original message was a bit confusing since the OP seemed to want the backward/forward arrows on each page not just at the start of a chapter.
DNSB is offline   Reply With Quote
Old 09-29-2024, 03:32 AM   #546
PubFut
Junior Member
PubFut began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2024
Device: Sigil
Purpose of the plugin

Thank you for all replies! I understand that this seems a bit strange. But the html produced by this plugin is not supposesd to be used with an ebook reader, but will be exported as pure html to be used with a webbrowser. Therefore, the navigation tools of ebook readers are not available. In the html version there will be a button that makes the TOC slide in or out as the user requests. So it will work similar to the TOC popup in an ebook reader.
PubFut is offline   Reply With Quote
Old 09-29-2024, 05:57 PM   #547
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,372
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Sigil is not a (X)HTML editor. It is intended for editing ePub files which use a limited subset of HTML/CSS. While quite a bit of HTML/CSS works in ePub, there is a fair bit that does not.

You might be able to take a look at the code used and modify it to meet your needs. Looking at Boundary from Baen's Free Library, it looks to be a fairly simple task to add back/next/Toc to an HTML file.

I've attached the free library version of Boundary.
Attached Files
File Type: zip H1416509321.zip (1.17 MB, 34 views)
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading Plugin in development Sladd Development 6 06-17-2014 06:57 PM
Question for plugin development gurus DiapDealer Plugins 2 02-04-2012 11:33 PM
DR800 Plugin development for DR800/DR1000 yuri_b iRex Developer's Corner 0 09-18-2010 09:46 AM
Device plugin development reader42 Plugins 10 03-29-2010 12:39 PM
Calibre plugin development - Newbie problems minstrel Plugins 5 04-12-2009 12:44 PM


All times are GMT -4. The time now is 04:15 AM.


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