Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-26-2022, 04:02 PM   #1
rdoca
Junior Member
rdoca began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2022
Device: sigil
Wink How to convert toc.xhtml to toc.ncx


I'd looking for in the 'plugins list' and in this forums and not found references at this issue.

Explaining my point:
I'm copying text (large of) in xhtml and your respective toc.xhtml from online source. However, the file toc.ncx (or nav.html) it's not available.

It's possible running at toc.html to transform it in toc.ncx?

I believe this is an opportunity to make a new plugin. I understanding Python, but I don´t know which libraries using to this.

Anyone is available to a partnership?
rdoca is offline   Reply With Quote
Old 10-26-2022, 05:30 PM   #2
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,761
Karma: 5706256
Join Date: Nov 2009
Device: many
Make the toc.html the nav (import it to Sigil into an empty epub3 and copy and paste its contents into the nav.xhtml.

This assumes your toc.xhtml follows the general rules for nav.xhtml documents.

Then use Sigil's epub3 specific tools menu to generate the ncx from the nav.

Last edited by KevinH; 10-26-2022 at 06:24 PM.
KevinH is online now   Reply With Quote
Advert
Old 10-26-2022, 06:28 PM   #3
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,761
Karma: 5706256
Join Date: Nov 2009
Device: many
Or if your html files properly use heading tags h1-h6, then just create the ncx directly from the actual headers of the xhtml chapter files.
KevinH is online now   Reply With Quote
Old 10-27-2022, 06:09 AM   #4
rdoca
Junior Member
rdoca began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2022
Device: sigil
Quote:
Originally Posted by KevinH View Post
Or if your html files properly use heading tags h1-h6, then just create the ncx directly from the actual headers of the xhtml chapter files.
No, it`s not a option. No headers exist in html texts.
rdoca is offline   Reply With Quote
Old 10-27-2022, 06:13 AM   #5
rdoca
Junior Member
rdoca began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2022
Device: sigil
Quote:
Originally Posted by KevinH View Post
Make the toc.html the nav (import it to Sigil into an empty epub3 and copy and paste its contents into the nav.xhtml.

This assumes your toc.xhtml follows the general rules for nav.xhtml documents.

Then use Sigil's epub3 specific tools menu to generate the ncx from the nav.
Thanks by the fast answer.
Well, this is a manual solution that works.
But, I believe that is equal job make the headers in html texts.
rdoca is offline   Reply With Quote
Advert
Old 10-27-2022, 08:57 AM   #6
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,761
Karma: 5706256
Join Date: Nov 2009
Device: many
For accessibility reasons, adding structural heading tags is important. If there is a some way to use find and replace to generate proper heading tags, that would be best.
KevinH is online now   Reply With Quote
Old 10-27-2022, 09:11 AM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by rdoca View Post
Thanks by the fast answer.
Well, this is a manual solution that works.
But, I believe that is equal job make the headers in html texts.
As Kevin explained, there are very legitimate reasons why you should be using heading formatting in the first place--it's not "only" formatting or how something looks. Headings are STRUCTURAL. They are intended to provide guidance, to the device, the firmware, etc. about what's what.

No software has the ability to look at, say, 2700 paragraphs of text and magically pick out the relevant structural headings and from thence, create an NCX or Nav. You have to give it SOME help and honestly, this is typically done at the word processing stage (Word, AWP, LO, whatever); then simply exported to HTML with the appropriate HTML tags (h1, h2, etc.) and then, in Sigil, you can simply use that to build your own NCX or NAV (or both).

It's a critical part, really, of understanding how ePUBs work and all that. It's something that should be done regardless of the later intended use, especially around accessibility. It's also important around usability issues--if you have headings and all that, you can easily and with pretty much 2 clicks, break the ePUB file into separate XHTML files, to reduce the load on the reading device. Much more efficient, better rendering, and all that.

Yes, if you haven't already done it, it's a bit of work NOW, but if you use headings and Styles (word-processing-wise or markdown or whatever you're doing) during the writing/editing, this is all pretty much a snap. Not to mention all the good things it does for you during that word-processing stage, as well.

HTH

Hitch
Hitch is offline   Reply With Quote
Old 10-27-2022, 10:14 AM   #8
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,761
Karma: 5706256
Join Date: Nov 2009
Device: many
If there is some detectable pattern of heading titles , you should be able to use Find/Replace with regular expressions to insert the required h1-h6 tags automatically.
KevinH is online now   Reply With Quote
Old 10-27-2022, 11:23 AM   #9
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: 28,569
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
One might also be able use the Tag Mechanic plugin. If there's p tags that use a consistent class attribute for chapters, those could easily be converted to h tags.
DiapDealer is offline   Reply With Quote
Old 10-27-2022, 11:35 AM   #10
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by KevinH View Post
If there is some detectable pattern of heading titles , you should be able to use Find/Replace with regular expressions to insert the required h1-h6 tags automatically.
Yup, but I thought that perhaps a discussion of why Headings matter might...well, be beneficial, first. I did think that there was definitely room for some Regex Magic if the "chapter" or other were used.

Quote:
Originally Posted by DiapDealer View Post
One might also be able use the Tag Mechanic plugin. If there's p tags that use a consistent class attribute for chapters, those could easily be converted to h tags.
Yupperdoodle.

Hitch
Hitch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some files.html & toc.xhtml (also Cover.xhtml) chaot Workshop 23 02-13-2017 12:20 PM
Ho do I create a TOC for ePub which does convert to an active TOC in Kindle Previewer K-Thom Calibre 1 09-24-2013 06:32 PM
Kindler previewer not recognizing toc.ncx file, my html toc, or the start point... petercrowell Kindle Formats 2 05-01-2012 08:14 AM
Inline TOC from toc.ncx elmago79 Kindle Formats 38 03-25-2011 12:56 PM
Use Regex to Code an Inline TOC, from an External TOC's .ncx File mostlynovels ePub 2 03-16-2011 12:15 PM


All times are GMT -4. The time now is 04:38 PM.


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