View Single Post
Old 06-23-2020, 04:03 PM   #12
Mister L
Groupie
Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Mister L is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Posts: 179
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
Quote:
Originally Posted by Tex2002ans View Post
The real question is: Does this belong in a TOC at all?

I would strongly lean towards No.
Well, you might lean towards no, but sometimes the publisher disagrees, and in many cases I also disagree.

Either way, to be honest, at this point I would prefer for the real question of this thread to be whether or not there is any hope of seeing a plugin just as we've described. Everything else, at this point, is sort of extraneous to the discussion.

Quote:
Originally Posted by Tex2002ans View Post

Sometimes that's what you have to do. Especially if you get some hideous code that's inconsistent spaghetti gobbledeegook like you brought up in this thread.

I'm going to pull a JSWolf and say clean the code up and make it consistent first, then your life will be much easier with the Regex going forward.
Trust me, I don't need to be told to clean up the code. But part of doing a good job is having the right tools for the job. As I've already said, I DO USE REGEX to clean up the code including to prepare the TOC generation, however I am convinced there is a better way to do that specific thing. It's a separate question to cleaning up the code. Unfortunately I'm not (currently) capable of making the tool I need. If no-one else is interested, that's fine, I'm not going to keep pushing it, it just seemed to me that we got a bit distracted by discussions about regex so I wanted to check where things stood.


Quote:
Originally Posted by Tex2002ans View Post

On your Title Casing problem. There are a few solutions, but I've found almost all the be suboptimal and have their own issues on edge cases.

Back in 2014, I used this Regex:

https://www.mobileread.com/forums/sh...53#post2930153
https://www.mobileread.com/forums/sh...d.php?t=233018

(I still use similar nowadays.)

Calibre introduced a "Function Mode" and even has an entire section dedicated in the manual for it, "Automatically fixing the case of headings in the document".

But most of the solutions I've come across the years don't take into account the nuances needed for proper Title Casing (different Style Guides require different rules).

This is the site I use:

https://capitalizemytitle.com/

It handles title casing better than many of the other tools I've run across over the years... and it does handle edge cases like caps after : or EM DASH.

But you always get stuff like: DNA, RNA, mRNA, First/Last names (DeSanto, McDonald), etc.
You're kind of making my point for me here to be honest... Do you see how complicated this is, when the work has already been done and the correct titles are already in the file?? Wouldn't it be easier to just click on a plugin and copy them over to each chapter?


Thanks for those suggestions though, and if I get stuck on something in future I will take a look. The small-caps titles were last week so I don't need that at the moment, I'm working on a different project now. Either way, I don't really want to fiddle around with a different site to fix the cases of 2 words every 3 chapters because frankly at that point it's just faster to do it by hand. Plus it looks like that site is in English, most of the books I work on are in French.

Like I said, I do know how to do this the hard way, I am trying to find a better way.
Mister L is offline   Reply With Quote