Comments (12)
I think I might be able to do this, but it will depend a lot on how the TOC is constructed whether I can do this reliably. And it's something that I would set up as an option, default off, because there may be chapter names instead that may be preferred to be shown over "Chapter X". Some investigation will need to be done.
from calibre-kobo-driver.
Many thanks as I would like to know which chap as Kobo gives chap details not number. Await your further comments.
I seems .kepub.epub is ok in ver 2.4 although I have not received it yet.
from calibre-kobo-driver.
So, it seems like it would be possible to do, but there's no way it could be reliable. The closest I could come would be to find all navPoint
elements with class="chapter"
and run an incrementing counter to replace whatever chapter text is there with "Chapter X". However, this could be misleading and end up just as confusing for you as having only the text display. Take this fragment of a TOC file from a professionally-published ebook:
<navPoint class="chapter" id="971c6981-4d9a-4738-87df-9f7f11c6bb0f" playOrder="1">
<navLabel>
<text>Dedication</text>
</navLabel>
<content src="Into_the_Woods_split_001.html"/>
</navPoint>
<navPoint class="chapter" id="ba1a9e96-3f89-4ddd-a0d3-b6bee7d43883" playOrder="2">
<navLabel>
<text>The Hollows</text>
</navLabel>
<content src="Into_the_Woods_split_003.html"/>
</navPoint>
<navPoint class="chapter" id="eb50b2f0-cf6b-4fb2-a5cc-13da5cc3035c" playOrder="3">
<navLabel>
<text>The Bespelled</text>
</navLabel>
<content src="Into_the_Woods_split_004.html"/>
</navPoint>
What you should see as chapter titles down at the bottom of the page is:
- Dedication
- The Hollows
- Chapter 1 (alternatively: Chapter 1 — The Bespelled)
What you would actually see, because these navPoint
elements all have class="chapter"
even where they should have something more appropriate, is this:
- Chapter 1 — Dedication
- Chapter 2 — The Hollows
- Chapter 3 — The Bespelled
I can implement this, find all navPoint
elements that claim to be chapters, but based on a sample from my personal library from different professional publishers it's highly likely that you would find the end result to be more confusing. I couldn't find any books in my library that would only show a page number, but the results would be the same as for books that do show chapter text of some kind. Take the same NCX fragment as above, but modified to remove the identifying text:
<navPoint class="chapter" id="971c6981-4d9a-4738-87df-9f7f11c6bb0f" playOrder="1">
<content src="Into_the_Woods_split_001.html"/>
</navPoint>
<navPoint class="chapter" id="ba1a9e96-3f89-4ddd-a0d3-b6bee7d43883" playOrder="2">
<content src="Into_the_Woods_split_003.html"/>
</navPoint>
<navPoint class="chapter" id="eb50b2f0-cf6b-4fb2-a5cc-13da5cc3035c" playOrder="3">
<content src="Into_the_Woods_split_004.html"/>
</navPoint>
Based on what we already know, we should see something like this:
- Page 1 of 1
- Page 1 of 1
- Chapter 1 — Page 1 of X
However, you would actually see that your book starts on "Chapter 3":
- Chapter 1 — Page 1 of 1
- Chapter 2 — Page 1 of 1
- Chapter 3 — Page 1 of X
A third case is where the chapter text already includes "Chapter X". For me, that would be very simple: don't touch it.
So, in short, I can do this if you want but I want to make sure you understand that the results are most likely going to appear to be incorrect even if this feature functions perfectly.
from calibre-kobo-driver.
The text that appears on the footer are the names defined in the TOC... if this one is properly written, why would you want to change them?
from calibre-kobo-driver.
I don't think you can programmatically determine "properly written", so if this is to be done I think it will strictly be "only if there is no chapter text". I'm trying to think of how I could do it to be least confusing. I found a book after posting last night that has both chapter number and name in the TOC, so really it looks like it's only feasible to do this where no chapter text exists already.
from calibre-kobo-driver.
Thanks for your thoughts.
As I new to epubs does the TOC determine to table of contents.
How can I paste a copy of of 2 TOC as examples
Many thanks
Michael
from calibre-kobo-driver.
Take a look at https://help.github.com/articles/github-flavored-markdown for details on how to format things. Specifically, you'll want the Syntax Highlighting section. The example there is for Ruby, but if you replace "ruby" with "xml" and paste in your XML that will do it. You can use the Preview tab right above the editor to see what your comment looks like before you submit it.
from calibre-kobo-driver.
Thanks will do that.
Also "As I new to epubs does the TOC determine to table of contents?"
from calibre-kobo-driver.
Ahh, yes. For EPUB2 books, the NCX file (typically named toc.ncx
in my experience) defines a few things:
- The Table of Contents that would be in a paper book, via the
navMap
element and itsnavPoint
children. - The order to show chapters in, via the
playOrder
attribute tonavPoint
, or by the order they appear in the document in the absence ofplayOrder
. - The title for each chapter, by the text content of
navMap > navPoint > navLabel > text
, and the file where the chapter starts, by thesrc
attribute ofnavMap > navPoint > content
.
from calibre-kobo-driver.
Thanks for thoughts will come back with reply but may not be soon as wife just taken into hospital
from calibre-kobo-driver.
Take your time, I hope everything turns out well for you both.
from calibre-kobo-driver.
I'm going to close this for now. Once everything has settled down for you and you have time, feel free to re-open this bug report. Again, I hope everything is going well for you and for your wife.
from calibre-kobo-driver.
Related Issues (20)
- Libra 2 HOT 3
- Missing cover after the conversion HOT 4
- 'Untitled Chapter' bug for all chapters after kepub conversion
- Obok DeDRM plugin not functioning in Calibre 6.0 HOT 1
- Kepub Output - QT errors in Calibre 6.x HOT 4
- UniCodeDecodeError HOT 1
- "Continue on error" for copy jobs with multiple books that fails because of content errors HOT 2
- List name of failing book in the job log error message. HOT 1
- name of file after converting EPUB to KEPUB HOT 1
- Add support for 4.34.20097 firmware HOT 1
- Send to device always results in epub, not kepub HOT 1
- Error Communicating with Device (TimeoutError on conversion)
- Updating an existing ebook on device does not take new pages into account HOT 8
- Process for importing (new?) Amazon Kindle Unlimited Voucher-associated file content HOT 2
- Conversion to kepub fails with "list index out of range" HOT 1
- Retrieving annotations not working (but 3rd party Annotations plugin works) HOT 1
- KoboTouchExtended: Error communicating with device HOT 5
- synopsis not loaded HOT 1
- SafeConfigParser has been removed in Python 3.12 HOT 1
- Option to not encoding non-English "Send-to" path into English one HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calibre-kobo-driver.