gutenbergtools / autocat3

CherryPy App that serves dynamic content for Project Gutenberg
GNU General Public License v3.0
2 stars 6 forks source link

Subtitle truncation not quite right #110

Closed gbnewby closed 4 months ago

gbnewby commented 8 months ago

The production team reported that truncation on the landing page doesn't seem quite right.

See: https://gutenberg.org/ebooks/71695

Truncation at the top of the landing page is "a", which seems incorrect. The full subtitle is part of the bibrec & database. This is correct. Truncation within the HTML & text is "China." This seems better than what's at the top of the landing page.

eshellman commented 8 months ago

Strings in this element are truncated at word breaks so that the length is <80 character. There are several titles in the db over 300 characters long.

One mitigation might be to add after truncated strings. A bit tricky given the other uses of the truncated title.

We could also use the full title and use css to allow the title to overflow the element's bounding box. This would be much cleaner, but could have unexpected rendering consequences for long titles.

A simple partial mitigation that would work for this book, and those that have been processed after ~ the beginning of 2023 is to use title_no_subtitle instead of a truncated title. This would look terrible for the older long titles in the backlist, and would probably be called out as an error when the title without subtitle is a single short word.

One more option is to modify the truncation algorithm to not widow single letter words or punctuation at the end of a truncated title.

"won't fix" is also an option 😄

eshellman commented 8 months ago

I don't really have a preference.

gbnewby commented 8 months ago

My preference is single-letter word anti-widowing, perhaps with a little additional intelligence:

I think this approach will make the displayed title look less like an error.

I would have liked to include "..." when truncation happens, but understand why that might be more challenging.

On Tue, Oct 17, 2023 at 8:30 AM Eric Hellman @.***> wrote:

I don't really have a preference.

— Reply to this email directly, view it on GitHub https://github.com/gutenbergtools/autocat3/issues/110#issuecomment-1766660914, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQRDLWOFL2ZPFPGU632GWLX72QAPAVCNFSM6AAAAAA6COSJ56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRWGY3DAOJRGQ . You are receiving this because you authored the thread.Message ID: @.***>

eshellman commented 8 months ago

I think if we use '...' (3 dots) instead of '…' my concerns go away, and I'd rather do that that deal with drop words - someone's always going to complain. Also, punctuation is too complicated to get right.

gbnewby commented 8 months ago

Yes, I agree.

On Wed, Oct 18, 2023 at 11:03 AM Eric Hellman @.***> wrote:

I think if we use '...' (3 dots) instead of '…' my concerns go away, and I'd rather do that that deal with drop words - someone's always going to complain. Also, punctuation is too complicated to get right.

— Reply to this email directly, view it on GitHub https://github.com/gutenbergtools/autocat3/issues/110#issuecomment-1769067227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQRDLSX64A65OWTRDXL5M3YAAKYDAVCNFSM6AAAAAA6COSJ56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRZGA3DOMRSG4 . You are receiving this because you authored the thread.Message ID: @.***>

gbnewby commented 6 months ago

This looks complete, to me. Truncation is much better. Unless there is further ongoing work, this issue can be closed.

eshellman commented 6 months ago

not deployed on production yet

On Dec 29, 2023, at 10:24 AM, Greg Newby @.***> wrote:

This looks complete, to me. Truncation is much better. Unless there is further ongoing work, this issue can be closed.

— Reply to this email directly, view it on GitHub https://github.com/gutenbergtools/autocat3/issues/110#issuecomment-1872166977, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHCGMN4U4DKDXLP54KJXU3YL3ODRAVCNFSM6AAAAAA6COSJ56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGE3DMOJXG4. You are receiving this because you commented.

eshellman commented 4 months ago

done in #117, and deployed Jan 12