Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML: Assign glossary terms with grouping keys to single-character groupings #12862

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jayaddison
Copy link
Contributor

@jayaddison jayaddison commented Sep 5, 2024

Feature or Bugfix

  • Bugfix

Purpose

  • Group glossary items by a single-character symbol instead of grouping key (when present).

Detail

  • Instead of short-circuit returning the (optional) category_key -- the entire grouping key name -- and using that as a heading to place glossary terms under, instead derive a single-character symbol from category_key.
  • This borrows existing logic used in the _key_func_1 function.

Concerns

  • I'm uncertain whether this grouping logic is valid for locales other than Latin-based scripts. In particular, there are some use cases for Katakana in the test suite that seem to indicate that glossary grouping keys are used for curated organization of index entries.

Relates

Screenshots

Before (en)
image

After (en)
image

Edit: fixup: I'd uploaded an incorrect after-fix sample image, containing a made-up fooon fermion in the glossary. That is now corrected.

This fixes a bug where previously the `category_key` -- an optional
grouping that can be specified on glossary terms -- was used directly
as the group name to place terms within in the generated HTML index.

The fix re-uses a similar logic flow as used in `_key_func_1`, where
the `category_key` is used to derive (but not as an absolute source
of) the index group.
The grouping key (`category_key`) from glossary terms is used to
decide what symbol/character to group the corresponding terms into.

However: the terms are not guaranteed to begin with the same symbol
as the `category_key`.  This code therefore places them into a nested
definition entry in the index, with the complete `category_key` as
the parent label.

Relates to commit 4255bbe.
@jayaddison
Copy link
Contributor Author

Is there anyone who could help me confirm whether this would introduce a significant functionality regression for Japanese-language projects in particular? When I was browsing through the test cases, I remember finding some fixtures that suggested that these glossary terms can be useful to select multi-symbol headings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML generated index: glossary categories unexpectedly appear within the letter-names list.
1 participant