feat(typst-community/glossarium/#188): adjust default styling in glossary#190
Conversation
…styling in glossary so that applied styling on glossary entry is removed
|
Maybe as a small info: I also used ai when updating/writing the signatures/docs. Hope that's fine :) |
That's fine as long as you actually read and tested the patched before submitting it. |
I'm sorry to say I fail to see where the problem is. Can you explain your line of thought? IMO, if a user defines a short to be |
Hey! I would say that also applying the raw-block in the glossary by default is in the majority of times NOT the intended behavior the user wants. The user wants a uniform styling in its glossary and therefore I suggest also implementing this to enforce this. If you think that this does not fit with your understanding, what about a feature toggle In my case I now implemented a custom What is your opinion on that? p.s.: Sorry for taking so long to reply |
… `get-plain-text` correctly
…xt` call to `get-plain-text` During refactoring and renaming the function I did not update all occurrences of the function
NP!
Are you saying that you want MDC to be raw(MDC) for references @MDC but not in the printed glossary? |
Yes that's exactly my point. What are your thoughts on that? |
Resolves #188
Problem
Currently, if a user defines an entry with internal styling (e.g., using raw() for an acronym), that styling "leaks" into the printed glossary. This creates inconsistent visuals when mixed with plain-text entries.
In the example above, "MDC" would appear in a monospace font while "CPU" follows the document's body font, breaking the visual rhythm of the glossary list.
Solution: get-plain-text
I have introduced a
get-plain-text(object)helper. This function recursively digs through Typst content to extract raw strings, effectively "cleaning" the data beforedefault-print-titleapplies its own consistent styling (likestrongoremph).Why not other approaches
style-entriesallows for global customization, it doesn't solve the problem of individual entries containing internal formatting that conflicts with the glossary's design. The glossary should have the final say on the title's appearance to ensure consistency.default-print-titlefunction in this case is best from my point of viewdefault-print-descriptionuntouched, as users often want to use styling within the body of a definition, whereas a title should remain a clean, predictable identifier.Documentation Updates
The existing internal documentation was technical and sparse. I have updated the docstrings for
default-print-titleandget-plain-textto be more beginner-friendly, focusing on the "what and why" of the functions.Feel free to comment on my changes or even suggest a different approach!