![]() |
#526 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,072
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Ignoring the AI aspect of all of this.
Although a plugin like this is doable, there really is not a lot of need for one. Let me explain. Normally, authors of books write and do primary editing of their books in a Word Processor like LibreOffice or Word remembering to properly specify and use styles. Then the epub dev person can either export that word document as html to load it into Sigil or use one of the existing Sigil import plugins to load it. There is very little need to create lots of html by hand. Next Sigil has the ability to use user supplied text Clips. Many users assign a few of the most common html tags to the clip so they can insert them with a single click on any of the 40 clip icons Sigil supports. Sigil already starts every page with the proper xhtml framework that is equivalent to what your example haml code would produce but for Sigil, since epubs need proper xhtml, Sigil uses that not the more loosely formatted xhtml. So rarely do epub developers need to hand create large blocks of html/xhtml code. They in fact spend a large part of their time cleaning up the poor html most other programs create, adding the proper css styling, reformatting footnotes, adding images, cover, etc and even javascript if needed. Now if you know of a good html editor that produces haml, then by all means you could create and use a plugin to read it in and convert it to xhtml. Alternatively you could run a standalone program to convert haml to html and then import that to Sigil right now. Hope this explains things better. |
![]() |
![]() |
![]() |
#527 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
|
Developer for little Sigil Plugin
Hello, I am looking for a developer who can build a little Sigil plugin that adds "Back" and "Forward" buttons at the end of every page to navigate through a book in an HTML export from an EPUB. Is there anyone interested in doing this as a work for hire?
If this is not the right place for this request, I am sorry and grateful for any advice where to post it. Best regards, Bertram |
![]() |
![]() |
Advert | |
|
![]() |
#528 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,865
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
This is the right place. I'm just not sure it's doable (or that I understand correctly). Unless it's a fixed layout (pretty rare), epubs don't have "pages." They reflow based on font size and margin/line-height preferences. So there would be no programmatically definable "end of every page." And an HTML export would be in the same boat. An HTML book would endlessly scroll--with no need for page buttons. Unless you're talking chapters or sections?
|
![]() |
![]() |
![]() |
#529 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
|
Thank you for your fast reply
If it is possible to retrieve the file name of the previous and following xhtml file within the file list of the EPUB than it shoud be doable. In this case in the following html snippet only in the "href="XXX.xhtml" the "XXX.xhtml" needs to be replaced once by the file name of the previous file and once by the file name of the following file. Inserting this code snippet in every file before the </body> tag should do the job. Shouldn't it?
Code:
<div class="wh_prev_next"><a class="wh_prev_next_link" href="XXX.xhtml"><span class="icon-arrow-left"> </span><span style="vertical-align:top; font-size:large;">Previous</span></a><a class="wh_prev_next_link" href="XXX.xhtml"><span style="vertical-align:top; font-size:large; padding-right: 1em;">Next</span><span class="icon-arrow-right"> </span></a></div> |
![]() |
![]() |
![]() |
#530 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,865
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#531 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
|
Essentially, what I am looking for is a function that replaces some string like "Previous.xhtml" by the file name of the previous file in the file list and "Next.xhtml" by the file name of the following file. Everything else is still in place. Just this part is missing.
|
![]() |
![]() |
![]() |
#532 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
|
|
![]() |
![]() |
![]() |
#533 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 757
Karma: 2296998
Join Date: Jan 2017
Location: Poland
Device: Various
|
Try this.
Quick & dirty, but it should work. |
![]() |
![]() |
![]() |
#534 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
|
Thank you very much!
Great job, works like a charm! How may I express my gratitude?
|
![]() |
![]() |
![]() |
#535 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
|
Create chapter TOCs
I have another little task that may be a bit more complicated but also not too difficult: I would like to auto-generate a litte TOC in a <nav> section of every chapter/html file. It shall include entries for the current file itself and for all subordinated files and their headings from H1 to H3 with classes from the sgc-toc.css.
So steps could be: 1. Create a TOC entry for the current chapter in the <nav> section of the current file 2. Create additional entries for every subordinated file/chapter with correct classes from sgc-toc.css 3. Go to next file: If it is subordinated just copy the created TOC from the <nav> section of the previous file 4. If it is NOT subordinated, start with 1. Perhaps it can also be done based on the existing HTML-TOC generation. But as I am not a developer I do not have enough insight. |
![]() |
![]() |
![]() |
#536 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
|
Generate chapter TOCs
I have another need for a small feature: It should auto-generate a linked chapter TOC in the <nav> section of every chapter/html file including an entry for the current file itself and for all subordinated chapters/files with headings H1 to H3 using classes from sgc-toc.css.
Perhaps this can be done based on the exiting feature for generating a HTML TOC for an entire ebook. But I am not a developer and do not have enough insight. Otherwise the steps could be: 1. Generate an entry / several entries for the H1-H3 heading of the current file in its <nav> section 2. Add entries for H1-H3 headings of all subordinated files 3. Go to next file: If it is subordinated just copy the generated list from the previous file 4. If it is not subordinated restart with 1. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |