-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: add overrides num-columns
and group-heading-level
#60
Conversation
Before this change, `group-heading-level` defaulted to reusing the last heading level found in the document. This is unlikely to always work for users. This new parameter allows users to override the default. Additionally, to give users some ability to style the output without needing to override `user-print-glossary`, the new `num-columns` parameter gives users the ability to control the number of columns groups are printed in.
Thanks! Will take a look at the group-heading. |
Understood. Glad to move it to a new PR. If columns is not set (ie default 1), we could make sure it's not in a column container. IOW, only contain it in |
I agree, multi-column glossaries are very common, but I cannot think of a
good reason why glossarium should take on the responsibility of the
document layout.
Typst exposes a very intuitive interface, where the end user can just set
columns for the glossary.
By default, I think any layout behaviour is outside glossarium's scope.
We do need better documentation for sure, more examples perhaps.
Le mar. 1 oct. 2024 à 20:01, Stephen Waits ***@***.***> a
écrit :
… Understood. Glad to move it to a new PR.
If columns is not set (ie default 1), we could make sure it's not in a
column container. IOW, only contain it in #columns() when the user asks
for something >1. Does this make it more amenable? The reason I added it,
for my own need, is because index-style glossaries are often multi-column.
It felt like something users may commonly want, and this way they can get
it without the trouble of re-implementing a bunch of functionality in the
library.
—
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE3OKGUXSY7RESCPPCCSPKDZZLPRHAVCNFSM6AAAAABPEMNYOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBWGYZDQOBZG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm fine with that. I think my challenge with the current interface for overriding styling is that it forces the user to mix logic with styling. I don't want to re-implement But again, I understand your point, completely. It is also weird to take what I'm saying in the complete opposite direction and start polluting the glossarium internals with styling overrides. |
BTW, for some inspiration, check out https://en.wikipedia.org/wiki/Citation_Style_Language if you haven't seen it already. It's not perfect, but it does completely separate logic from presentation. |
Yes, the main point of the current styling is to allow advanced users who are familiar with Typst scripting to only modify the relevant elements. For the columns option:
Finally, thanks for the discussion, it's great to know other people are interested in making glossarium better |
Hi, two questions about the 1- Sorry for bothering, but what's the current status on this? 2- Wouldn't it be better if the default value for group heading levels, instead of being "the same as the previous", was "the same as the previous, plus one"? I understand that this PR aims to allow the user to choose, but the thing is that the default value before Typst 0.12 was "plus one", and honestly it seems more logical to me (I'm open to counter-arguments though). Besides, I've only just noticed, completely by chance, that the current value breaks my post-0.12 template, and I suspect that this breakage is the same with the majority of the users at this point. |
I don't think any default makes sense. Some users might want it same as before. Others might want it before+1. I've since found a workaround myself so I'm all set. But I'd say if you see more people run into this then we should consider adding some flexibility and control for heading level. |
My point with +1 being more logical is that a group is supposed to be a subcategory of terms within the glossary, and as such having a h1 "Glossary" title followed by also h1 titles for groups would be the same thing logically (in terms of outline) as multiple glossaries. Though then again, the workaround I found, which I suppose may be the same as yours, would be to print multiple glossaries too but with h2 titles before the subcategory ones, so the group feature might be pointless. |
I'll probably split the commit and implement the group-heading-level + 1 by default, and add group-heading-level parameter. |
Closes #60 Closes #67 Co-Authored-By: Stephen Waits <[email protected]>
Closing in favor of #73. |
Closes #60 Closes #67 Co-authored-by: Stephen Waits <[email protected]>
Before this change,
group-heading-level
defaulted to reusing the last heading level found in the document. This is unlikely to always work for users. This new parameter allows users to override the default.Additionally, to give users some ability to style the output without needing to override
user-print-glossary
, the newnum-columns
parameter gives users the ability to control the number of columns groups are printed in.