MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Consider a new domain name for our "glue" functionality

Open choldgraf opened this issue 5 years ago • 5 comments
trafficstars

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)

choldgraf avatar Mar 30 '20 20:03 choldgraf

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.).

rowanc1 avatar Mar 30 '20 20:03 rowanc1

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.

chrisjsewell avatar Mar 31 '20 05:03 chrisjsewell

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.

rossbar avatar Mar 31 '20 06:03 rossbar

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.

mmcky avatar Apr 06 '20 23:04 mmcky

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...)

choldgraf avatar Apr 21 '20 23:04 choldgraf