09-28-2024, 01:10 PM | #541 |
Junior Member
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. |
09-28-2024, 02:10 PM | #542 |
Sigil Developer
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. |
09-28-2024, 02:55 PM | #543 | |
Bibliophagist
Posts: 40,372
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Chapter 42 Section 01 Subsection 01-01 Subsection 01-02 ... Section 02 Subsection 02-01 Subsection 02-02 ... |
|
09-28-2024, 03:12 PM | #544 |
A Hairy Wizard
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?? |
09-28-2024, 03:26 PM | #545 | |
Bibliophagist
Posts: 40,372
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
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. |
|
09-29-2024, 03:32 AM | #546 |
Junior Member
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.
|
09-29-2024, 05:57 PM | #547 |
Bibliophagist
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. |
|
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 |