-
Notifications
You must be signed in to change notification settings - Fork 198
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
✨ New: add .glossary for attrs_block #719
Conversation
cc @rowanc1 @choldgraf for comment |
Codecov ReportBase: 89.81% // Head: 89.93% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #719 +/- ##
==========================================
+ Coverage 89.81% 89.93% +0.12%
==========================================
Files 23 23
Lines 2887 2892 +5
==========================================
+ Hits 2593 2601 +8
+ Misses 294 291 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
From a UX perspective this makes sense to me. I have found myself expecting definition lists to act like glossaries in the past and this would reduce the friction there. A couple thoughts:
|
it's in the new documentation: https://myst-parser--717.org.readthedocs.build/en/717/syntax/typography.html#definition-lists-and-glossaries |
Ah, so this is documented but not implemented, and this PR only adds the implementation? I was looking at the diff here and just didn't see any docs added which was confusing. Go for it though if it's already documented. |
it would be nice for sure, but I'm not sure how to do it, in a "non-hacky way", with the current syntax 🤔 |
IMO that's a fine case for "if you want more flexibility then just use the glossary directive". I feel like the short-hand ways are time savers but it's understandable to ask people to use more verbose syntax if they want the extra functionality, parameterization, etc |
This commit is cherry-picked from #717 With all the recent commits, I've basically been implementing things as I was writing that documentation. Then gradually extracting out individual implementations into separate PRs and re-basing |
Note also there is an issue tracking acronyms in jgm/djot#51, but it hasn't come to much yet, they mention there https://www.overleaf.com/learn/latex/Glossaries, and I have long while back written a sphinx extension to this effect: https://ipypublish.readthedocs.io/en/latest/sphinx_ext_bibgloss.html |
Yeah the UX around acronyms and plurals is kinda wonky, but IMO that shouldn't block this PR and it's a future thing to think about. |
Ok cool, thanks for the feedback! Will wait for @rowanc1 before merging |
Pointed here from the big release where I asked to not to have class-names on paragraphs become admonition directives. I don't have any of those concerns here -- I think that is because we aren't changing the semantic meaning of the content, it is going from a definition, to a tagged definition, and so the short hand I might have a few more opinions when I get to an implementation on glossaries myself, e.g. on plurals or adding other info. Some of that could be inline spans/roles on the term, or encouraging users to use the directive. All of that can be done later though! Also agree that this shouldn't be turned on by default (probably ever) to transform dl/dd/dt into glossary terms. |
Thanks @rowanc1 ! To note, another point of reference is: jgm/djot#128 |
MyST follows http://johnmacfarlane.net/pandoc/README.html#definition-lists, to denote lists of term -> definition.
It should be easy for users to turn one of these lists into a glossary,
where each term is uniquely referenceable across the entire project.
(note I don't think this should be "on by default", because there are many use cases where this is not desirable and would lead to many reference clashes, plus that would be breaking in myst-parser and so not really viable)
Sphinx has a glossary directive, however, this hard-codes in the parsing of their definition lists to have a subtly different syntax to that above, with no
:
(see https://github.com/sphinx-doc/sphinx/blob/30f347226fa4ccf49b3f7ef860fd962af5bdf4f0/sphinx/domains/std.py#L354)
Therefore, I feel that it is not really ideal for MyST.
The easiest way to achieve this with the "correct" syntax, as implemented in this PR, is to "turn on" glossaries, when a particular attribute is assigned to the list, with the simplest being a
.glossary
class: