MyST-NB
MyST-NB copied to clipboard
Consider a new domain name for our "glue" functionality
I've had a few more conversations with folks who found using the word glue a bit confusing. Partially because it is the same verb as the one to "glue a variable into a notebook".
One suggestion from @rowanc1, which I thought was pretty reasonable, was to just use the word var:. That way it is clear you're referring to a variable's contents. E.g. var:figure, var:string etc.
@chrisjsewell I feel like this is closer to your original idea of using nb:. What do you think about this?
(apologies for bringing up the naming again, but I think as we get clear user feedback in the early days we should incorporate it quickly...we definitely shouldn't be changing the user-facing API after folks really start using the tools, so better to get it right sooner)
Thanks @choldgraf -- I was planning to make this issue, but you beat me to it!
From my perspective, the functionality looks like this is creating a variable that is known by myst_nb and then later accessing that variable in another context.
from myst_nb import var # or create_var?
a = "my variable!"
var("my_variable", a)
This is really exciting for integrations into javascript, and having these be first-class would add to the in-text interactivity substantially. In my first reading of that nomenclature, it seemed odd to call it glue (especially in the table, where it shows up a lot). (Although, "glue" is also how Python as a language got started/branded ... so maybe there is historical precedent?!).
Quick edit: In my work, I have called the other side of this "display" i.e. {display}'my_variable' in myst syntax - this is because I have also introduced other ways to control/modify these in javascript/html (e.g. through interactive graphs/inputs etc.).
I'm too bothered either way TBH. As noted before, it requires minimal code changes; so as long as it doesn't class with any existing sphinx directives, then its fine by me.
I just came across the glue functionality when reading through the docs. FWIW I find the naming convention quite natural. I especially like the consistency between the names in code and text, i.e. glue("key", val) and {glue}`key`. I personally prefer this to say var("key", val) and {display}`key` as it's one less mapping to remember while writing (I understand that this is not what's being proposed above!).
Another thing I like is that "glue" feels like a nice generic term for all different kinds of outputs (figs, tables, text, etc.) whereas something like "var" or "out" feels like it's implicitly geared towards text and/or values.
I think there's a lot of merit to all the above ideas and just wanted add my two cents.
thanks @choldgraf for opening this discussion - I agree it is pretty important to get right at the outset. If having a separate show command is more flexible in supporting more complex objects in the future (i.e. javascript widgets etc) -- it may be a good way to go to distinguish between the two roles -- but I also like the simplicity of having a single word from an author perspective. I'm conflicted! :-).
My only other name ideas were link / connect. It seems to describe what is happening by connecting or linking documents.
I also don't mind if glue wins.
Following up on this - it feels to me like nobody has super strong opinions about this. Is that true?
(my inclination, if nobody has strong opinions, is to just keep doing what we're doing...)