You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In theory, anywhere where we have duplicated text (like in the intros software page, which copies from the software content on another page), we can glue to allow duplication.
So in the initial MD file, you'd add this to the top to make it an executable MD file
```{code-cell} ipython3
:tags: ["remove-cell"]
from myst_nb import glue
from IPython.display import Markdown
IJ="is an imaging processing program that is capable of operating on a variety of images including multichannel, 3D and time series. It provides a variety of basic imaging processing operations, but it can be complemented with a variety of plugins for more complex tasks."
glue("imagej_intro_md", Markdown(IJ))
glue("imagej_intro",IJ)```
The page text then just ends up becoming where the intro previously was
Some other text {glue}`RelpathToFile.md::imagej_intro` some other text
OR (less good for text)
```{glue} imagej_intro
:doc: RelpathToFile.md```
BUT, cross-page gluing is still finicky - AFAICT in testing, {glue:md} straightup just doesn't work, {glue:text} only works for NUMBERS on cross-page glues, it just doesn't embed anything if you try to use it on a string. {glue} alone on a text string within the same page puts the text in normal font etc, but just encloses it in quotes, but across to another page, you get the text as if it was enclosed in code ticks - it's not in a normal font (the exact flavor of weird is different for the two options, but neither is right).
I've already spent about 100X as long on this as I should have, because ultimately copying-and-pasting small amounts of text would have taken 10 seconds, but we always try to avoid this because ultimately the text is going to diverge, it just will. Hopefully future versions of glue will work better (and I will try to remember to write up an MWE to file an issue there), and if so, then hopefully these breadcrumbs will make it super fast to get this done when that day shows up.
The text was updated successfully, but these errors were encountered:
Yeah glue is like a dream that never quite got fully realized. It SOUNDS like it should do so much and fix all the problems I have with reusing variables but I find it almost never works as expected when the use case gets even a little complicated.
In theory, anywhere where we have duplicated text (like in the intros software page, which copies from the software content on another page), we can glue to allow duplication.
So in the initial MD file, you'd add this to the top to make it an executable MD file
Then your intros would be done like this
The page text then just ends up becoming where the intro previously was
And on the other page, you use
OR (less good for text)
BUT, cross-page gluing is still finicky - AFAICT in testing,
{glue:md}
straightup just doesn't work,{glue:text}
only works for NUMBERS on cross-page glues, it just doesn't embed anything if you try to use it on a string.{glue}
alone on a text string within the same page puts the text in normal font etc, but just encloses it in quotes, but across to another page, you get the text as if it was enclosed in code ticks - it's not in a normal font (the exact flavor of weird is different for the two options, but neither is right).I've already spent about 100X as long on this as I should have, because ultimately copying-and-pasting small amounts of text would have taken 10 seconds, but we always try to avoid this because ultimately the text is going to diverge, it just will. Hopefully future versions of glue will work better (and I will try to remember to write up an MWE to file an issue there), and if so, then hopefully these breadcrumbs will make it super fast to get this done when that day shows up.
The text was updated successfully, but these errors were encountered: