Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 12-21-2013, 02:00 PM   #1
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
ToC Editor functions

@kovid,

This isn't strictly-speaking about the ebook Editor but the TOC Editor, but as they are so closely related, I hope I can get away with it whilst editing functionality is still fresh in the mind
  1. I think there is a small bug in the Change all selected items to title case option. If an entry's text contains certain characters (non-ascii ???) then the text doesn't change to Title Case.
    e.g. FJÄLLBACKA or AUTHOR’S NOTE remain unchanged.
  2. I was wondering whether something similar to the ebook Editor's bulk file-renaming feature could be extended to the ToC Editor.
    e.g. suppose you use the Generate ToC from files option and the book uses images, rather than text, for its chapter headings. The ToC Editor obviously can't see the image text so you get paragraph 1 as the ToC entry text. The ability to select multiple entries and sequentially rename them Chapter 1, Chapter 2,... etc, (just like the ebook Editor's bulk file-renaming) would be really useful.
jackie_w is offline   Reply With Quote
Old 12-21-2013, 02:51 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by jackie_w View Post
@kovid,

This isn't strictly-speaking about the ebook Editor but the TOC Editor, but as they are so closely related, I hope I can get away with it whilst editing functionality is still fresh in the mind
  1. I think there is a small bug in the Change all selected items to title case option. If an entry's text contains certain characters (non-ascii ???) then the text doesn't change to Title Case.
    e.g. FJÄLLBACKA or AUTHOR’S NOTE remain unchanged.
  2. I was wondering whether something similar to the ebook Editor's bulk file-renaming feature could be extended to the ToC Editor.
    e.g. suppose you use the Generate ToC from files option and the book uses images, rather than text, for its chapter headings. The ToC Editor obviously can't see the image text so you get paragraph 1 as the ToC entry text. The ability to select multiple entries and sequentially rename them Chapter 1, Chapter 2,... etc, (just like the ebook Editor's bulk file-renaming) would be really useful.
Jackie
This may be a common problem ( I have seen it other places)

Not Tested
Try changing it to Lower First, Then do whatever case trick.
theducks is offline   Reply With Quote
Old 12-21-2013, 04:00 PM   #3
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by theducks View Post
Try changing it to Lower First, Then do whatever case trick.
There isn't a 'change to lowercase' option in the ToC Editor, is there?

As you say, I have seen lots of software where the Title Case feature is flawed, e.g. AUTHOR’S NOTE gets changed to Author’S Note, but I haven't seen a 'no change' one before.

Whilst giving the ebook Editor a good working over this week, I've been cleaning up a lot of Scandinavian crime novels, so this particular bug-ette has appeared quite a lot.
jackie_w is offline   Reply With Quote
Old 12-21-2013, 10:58 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
1) https://github.com/kovidgoyal/calibr...e5594270233db6

2) Sure, open a bug report for it so I dont forget
kovidgoyal is offline   Reply With Quote
Old 12-21-2013, 11:31 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
For #2: Sigil uses the title attribute to override the title in the ToC.
eschwartz is offline   Reply With Quote
Old 12-21-2013, 11:56 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by eschwartz View Post
For #2: Sigil uses the title attribute to override the title in the ToC.
You mean it uses the alt attribute from the image?
kovidgoyal is offline   Reply With Quote
Old 12-22-2013, 12:00 AM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by kovidgoyal View Post
You mean it uses the alt attribute from the image?
It could be it will read that as a default too. In fact I think it probably does, that makes sense. I do know, if the <h1> has a title attribute it will use that instead of whatever is inside the <h1> tag.
eschwartz is offline   Reply With Quote
Old 12-22-2013, 12:01 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by eschwartz View Post
I just know if the <h1> has a title attribute it will use that instead of whatever is inside the <h1> tag.
I can see doing that if the <h1> has no text content, otherwise, why?
kovidgoyal is offline   Reply With Quote
Old 12-22-2013, 12:18 AM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by kovidgoyal View Post
I can see doing that if the <h1> has no text content, otherwise, why?
In case someone edits the ToC while it's being generated, Sigil saves any changes as a title attribute so it persists next time someone hits generate ToC. Sometimes people don't want the exact text in the chapter heading to be used. I use it if there is an Also By page, it says "Also By {author}" but I just want the ToC to say "Also By". In a similar vein, the class "sigil_not_in_toc" is added to any header tag that has been deleted from the ToC. See screenshot -- if you uncheck "include", this element gets left off and the "sigil_not_in_toc" class is added. And Sigil will ignore it next time around. (Must use with care, since if you later decide to include it, you must manually edit to remove.)

Sigil likes to remember any tweaks in the Generate ToC process so as to save you the bother next time. I think it's nice.

And I checked it out, Sigil does NOT read the alt tag when generating the ToC.
eschwartz is offline   Reply With Quote
Old 12-22-2013, 12:29 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Why would you generate the toc more than once? Sigil's toc editor is rather underpowered and it can only generate tocs from headings/files, which is what makes all that rigamarole necessary. In calibre, you generate the toc once and if you later need to make changes to it, you do it in the very capable toc editor.
kovidgoyal is offline   Reply With Quote
Old 12-22-2013, 12:35 AM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by kovidgoyal View Post
Why would you generate the toc more than once? Sigil's toc editor is rather underpowered and it can only generate tocs from headings/files, which is what makes all that rigamarole necessary. In calibre, you generate the toc once and if you later need to make changes to it, you do it in the very capable toc editor.
Very true.

I suppose alt attribute makes a lot more sense here, since it should be there anyway to let people know there's a chapter there. Or just bulk rename.

I couldn't see the forest for all the trees in the way.
eschwartz is offline   Reply With Quote
Old 12-22-2013, 05:25 AM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...85e6f41bdff546

Last edited by kovidgoyal; 12-22-2013 at 05:31 AM.
kovidgoyal is offline   Reply With Quote
Old 12-22-2013, 08:38 AM   #13
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@kovid,

Fantastic I look forward to trying both of them next Friday.

What's particularly impressive is that could add item #2 in only 9 lines of code! The power of a well-designed application, I guess. I wonder who did that
jackie_w is offline   Reply With Quote
Old 12-22-2013, 08:45 AM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I've learned a lot in the last seven years of working on calibre. The code I write now is a lot tighter than it used to be. For instance, the entire Edit Book feature (apart from the code to explode and rebuild azw3) is only 11K lines.
kovidgoyal is offline   Reply With Quote
Old 12-22-2013, 10:20 AM   #15
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Kovid
Sigil's feature of using title="Alternate Title", WHEN PRESENT, seems reasonable
--
A chapter heading: Chapter 1
with a subheading (possibly with different CSS styling) on a second line: Lost in the Code
I have used so REGEX to construct the title="\1 : \2", which Sigil picked up in the TOC generation Chapter 1 : Lost in the Code

--

When using Image based titles. As you noted using alt= is probably not a great idea as there may be lots of other images that don't belong in the TOC but still have an alt=
Using the sometimes hidden: <h3 title="Chapter 1">&nbsp;</h3> is a easy workaround for a mixed methods book


In all case, my preference is towards helper tools rather than fully automatic features.

I frequently regenerate a TOC (until I get it just right! ). This may be why I lean towards using the single markup method
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Toc Editor alteration brewt Sigil 5 09-05-2012 08:24 PM
Sigil Toc editor Enesco Sigil 16 09-23-2010 06:41 AM
How does the TOC editor work? Kivgaen Sigil 31 06-25-2010 10:28 AM
Problem with TOC editor alecE Sigil 2 10-29-2009 01:30 AM
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working Magitek LRF 0 05-06-2009 01:25 PM


All times are GMT -4. The time now is 07:51 PM.


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