Skip to content

Dynamic Glossary#72

Merged
leeuwe merged 13 commits intomainfrom
glossary-proposal
Mar 26, 2026
Merged

Dynamic Glossary#72
leeuwe merged 13 commits intomainfrom
glossary-proposal

Conversation

@Snooz82
Copy link
Copy Markdown
Member

@Snooz82 Snooz82 commented Dec 5, 2025

This PR implements a dynamic glossary with search and alias.
The glossary is stored in a JSON file (website/static/glossary/glossary.json), so that the glossary definition can be used by dynamic glossary tool tips in all MarkDown documents.

2025-12-06_00-21-54.mp4

I implemented the glossary terms to be hovered and a dynamic glossary.

The glossary is based on a json file.

	{
		"term": "Named-Only Argument",
		"aliasses": ["Named Argument"],
		"abbreviation": "",
		"definition": "An argument that must be provided by name (never positionally); typically defined after a \"Variable Number of Positional Arguments\" or explicitly marked with a label icon in docs, and can be mandatory or optional."
	},

the usage is like this in Markdown:

Except for "Positional-Only Arguments", which are not part of this syllabus,
all arguments that are positioned before :term[Variable Number of Positional Arguments], :term[Named-Only Arguments]{term="Named-Only Argument"}, or :term[Free Named Arguments]{term="Free Named Argument"} in the argument interface of a keyword are :term[Positional or Named Arguments]{term="Positional or Named Argument"}.

so either if the exact term is used:

:term[Variable Number of Positional Arguments]

or in case a different grammatical form is used:

:term[Named-Only Arguments]{term="Named-Only Argument"}

Signed-off-by: René <snooz@posteo.de>
Signed-off-by: René <snooz@posteo.de>
@Snooz82 Snooz82 added this to the 1.0.2 milestone Dec 5, 2025
@Snooz82 Snooz82 self-assigned this Dec 5, 2025
@Snooz82 Snooz82 requested review from a team and Copilot December 5, 2025 19:13
@Snooz82 Snooz82 added the enhancement New feature or request label Dec 5, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

Signed-off-by: René <snooz@posteo.de>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

@Snooz82
Copy link
Copy Markdown
Member Author

Snooz82 commented Dec 5, 2025

2025-12-06_00-21-54.mp4

I implemented the glossary terms to be hovered and a dynamic glossary.

The glossary is based on a json file.

	{
		"term": "Named-Only Argument",
		"aliasses": ["Named Argument"],
		"abbreviation": "",
		"definition": "An argument that must be provided by name (never positionally); typically defined after a \"Variable Number of Positional Arguments\" or explicitly marked with a label icon in docs, and can be mandatory or optional."
	},

the usage is like this in Markdown:

Except for "Positional-Only Arguments", which are not part of this syllabus,
all arguments that are positioned before :term[Variable Number of Positional Arguments], :term[Named-Only Arguments]{term="Named-Only Argument"}, or :term[Free Named Arguments]{term="Free Named Argument"} in the argument interface of a keyword are :term[Positional or Named Arguments]{term="Positional or Named Argument"}.

so either if the exact term is used:

:term[Variable Number of Positional Arguments]

or in case a different grammatical form is used:

:term[Named-Only Arguments]{term="Named-Only Argument"}

Signed-off-by: René <snooz@posteo.de>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • website/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

Signed-off-by: René <snooz@posteo.de>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 7, 2025

@Snooz82 I've opened a new pull request, #73, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 7, 2025

Signed-off-by: René <snooz@posteo.de>
- [x] Revert to useMemo approach for entries and aliasToCanonicalSlug
- [x] Remove unnecessary purifyRef and purifyReady state
- [x] Simplify sanitization logic while maintaining security
- [x] Ensure proper SSR handling
- [x] Test and validate changes (TypeScript passes, dev server runs)
- [x] Clean up build artifacts from repository
- [x] Code review and security checks passed (CodeQL found no issues)

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Snooz82 <41592183+Snooz82@users.noreply.github.com>
Co-authored-by: René <snooz@posteo.de>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 7, 2025

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 7, 2025

Signed-off-by: René <snooz@posteo.de>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 7, 2025

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 7, 2025

@GerwinLaagland
Copy link
Copy Markdown
Collaborator

Based on some of the feedback during community day, I wanted to raise two more points of interest before we merge this:

1. A Term should exist as 'a term', aliases should not have their own entry
Aliases shouldn't have a 'separate' entry in glossaries, but mentioned just in the 'main entry' they can be searched with either specific or lazy search option. This can tighten the glossary a bit more instead of riddling it with additional 'terms' that are in fact only aliases. A term should reflect the actual term, not alternates for it.
image

2. Describe in the description if alternate word is an Alias or Abbreviation
For clarity it's preferable to know when something is considered an 'alias' or 'abbreviation', this should be displayed in the glossary description entries rather than having only a 'green block' that could be either. We should have not both entries be the same. (As we are seeing that with for example gTAA)
image

3. (Optional) Allow for a 'backlink' generated solution in Glossary / linking.
A notation method to link to a 'in context' location inside the glossary, so that people can navigate from the glossary to the place (or places) where they can read more about a term inside that context. This allows for navigation (with pop-up)

We could keep the current :term[...] notation and extend it only for the special cases where we want a glossary backlink.

Examples:

:term[Variable Scope]
:term[test cases]{term="Test Case"}
:term[Variable Scope]{source="#variable-scope-explained"}
:term[test cases]{term="Test Case" source="/docs/tests#test-case-structure"}

Proposal:

  • Keep :term[...] as the standard glossary link syntax.
  • Keep {term="..."} for alias text.
  • Add an optional source="..." attribute for the few cases where a glossary entry should offer a “read more” backlink into the docs.
  • If no source is given, no backlink is created.

4. (Optional) Support for Rabbit Holes
A suggestion was made that it would be nice to do 'pop-up within pop-up' allow for easy navigation of term descriptions that might lead to other terms again. An example was set sent to me, and can be found here:
https://mystmd.org/guide#cool-myst-features

Copilot AI review requested due to automatic review settings March 26, 2026 11:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions
Copy link
Copy Markdown

@leeuwe leeuwe self-requested a review March 26, 2026 13:34
Copy link
Copy Markdown
Collaborator

@GerwinLaagland GerwinLaagland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback will be raised as separate issues at a later date.

@github-actions
Copy link
Copy Markdown

@leeuwe leeuwe merged commit 7f8d557 into main Mar 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants