-
Notifications
You must be signed in to change notification settings - Fork 91
ENH: Add handling of image based PendingGlueReference in generate_any_nodes
#675
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
Conversation
b71488a to
5c9852e
Compare
|
This should be one step in the direction of #396, hopefully |
|
closes #591 |
|
closes #431 |
|
@StFroese - you need to add those close comments in the the pull request's description, so the issues will be automatically picked up for closure upon merge (https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) I'll try to come back to review and merge this later this week. |
|
@bsipocz thanks for pointing that out! It was more meant as a cross-ref to check if somebody agrees on closing these, should have made it more clearly. I'll go ahead and explicitly add the keyword in the PR description 😊 |
|
Fwiw, I prefer it if it's in the PR description, so it doesn't generate pings and references each time there is a rebase, etc. and also it's easier to edit if there is a disagreement about the issue is being addressed or not with the PR |
|
@bsipocz was just updating my comment from "commit message" to "PR description" as you wrote this haha! Done, thx! 😊 |
bsipocz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content here is convincing, however I wonder how it would work with markdown notebooks where we don't store the outputs in the notebook themselves? I mean that would be the actual use case most of the issues are referring to.
(after all all of our tutorial source code lives in myst markdown notebooks so the test case should handle those rather than an orphaned ipynb)
| :doc: orphaned_nb.ipynb | ||
| ``` | ||
|
|
||
| A cross-pasted `any` directive from an image: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
myst_nb/ext/glue/crossref.py
Outdated
| _nodes = generate_text_nodes(node, output) | ||
| else: | ||
| _nodes = generate_any_nodes(node, output, priority_list) | ||
| print("asdasg", self.app.builder.imagedir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this print a debug remnant?
bsipocz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have one more look at the weird colouring for the rendered docs, and remove the debug remnant, and if CI is green (with the exception of the known devtest sphinx deprecations) then I go ahead and merge this to include it in the new release.
|
Thanks @StFroese! |

Hi all 😊
I was in need of cross-gluing images/figures from my notebooks, well here I am 😄
I tried to add the handling of image mime types in the
generate_any_nodesforPendingGlueReferencewith image.This is mostly a copy of
mystnb/core/render.py::render_imagebut instead of writing the image again I try to figure out the existing uri and create the image node from it.I also added a figure to the orphaned notebook to display this feature in the docs 🎨
Comments are very welcome, I am very new to this codebase! 🙏
closes #591, closes #431