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 04-20-2024, 09:40 AM   #526
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: 7,901
Karma: 5449552
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.
KevinH is online now   Reply With Quote
Old Yesterday, 06:19 AM   #527
PubFut
Junior Member
PubFut began at the beginning.
 
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
PubFut is offline   Reply With Quote
Old Yesterday, 08:55 AM   #528
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,739
Karma: 197700000
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?
DiapDealer is offline   Reply With Quote
Old Yesterday, 12:51 PM   #529
PubFut
Junior Member
PubFut began at the beginning.
 
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>
PubFut is offline   Reply With Quote
Old Yesterday, 01:45 PM   #530
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,739
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by PubFut View Post
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?
Sure. That should be possible for someone. But you're talking about adding code to the end of every file/chapter, where you said pages. That's what I was looking to clarify.
DiapDealer is offline   Reply With Quote
Old Yesterday, 02:05 PM   #531
PubFut
Junior Member
PubFut began at the beginning.
 
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.
PubFut is offline   Reply With Quote
Old Yesterday, 02:07 PM   #532
PubFut
Junior Member
PubFut began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Aug 2024
Device: Sigil
Quote:
Originally Posted by DiapDealer View Post
you're talking about adding code to the end of every file/chapter, where you said pages. That's what I was looking to clarify.
Correct, "page" referred to the HTML output that I produce where every EPUB file/chapter results in an html page.
PubFut is offline   Reply With Quote
Old Yesterday, 05:27 PM   #533
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 722
Karma: 2296998
Join Date: Jan 2017
Location: Poland
Device: Various
Try this.
Quick & dirty, but it should work.
Attached Files
File Type: zip PrevNext_v001.zip (1.1 KB, 8 views)
File Type: epub PrevNextTest.epub (3.5 KB, 7 views)
BeckyEbook is online now   Reply With Quote
Old Today, 03:39 AM   #534
PubFut
Junior Member
PubFut began at the beginning.
 
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?
PubFut is offline   Reply With Quote
Old Today, 08:34 AM   #535
PubFut
Junior Member
PubFut began at the beginning.
 
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.
PubFut is offline   Reply With Quote
Old Today, 08:45 AM   #536
PubFut
Junior Member
PubFut began at the beginning.
 
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.
PubFut 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 12:36 PM.


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