🌉 Update images to work locally#145
Conversation
rowanc1
left a comment
There was a problem hiding this comment.
A few comments. I think this is good to go!
| cell?: MarkdownCell; | ||
| }; | ||
|
|
||
| export async function imageUrlSourceTransform( |
There was a problem hiding this comment.
This function was updated to remove the cell as a requirement, which has an attachments model.
| const file = new VFile(); | ||
| const references = { | ||
| cite: { order: [], data: {} }, | ||
| footnotes: {}, |
There was a problem hiding this comment.
This is just an update for myst which no longer separates these from the mdast.
| .myst img { | ||
| max-width: 100%; | ||
| } | ||
|
|
||
| .myst figure img { | ||
| display: block; | ||
| max-width: 100%; | ||
| } |
There was a problem hiding this comment.
Minor style updates to prevent crazy wide images in markdown previews.
| if (inNotebook) { | ||
| // If in the notebook, lift children out of blocks for the next step | ||
| // We are working here as one cell at a time | ||
| liftChildren(mdast, 'block'); | ||
| } |
There was a problem hiding this comment.
The structure of the markdown should stay in the blocks that the markdown gave, which is not the case for cells, which MUST lift children of the blocks so that we can target and identify them.
|
The link checker looks to be failing with |
| - name: Install missing dependencies | ||
| # On May 30, 2023 this wasn't included in the base try removing in future! | ||
| run: pip install typing_extensions |
There was a problem hiding this comment.
I added this to fix the CI, worst case it is a no-op. But it will probably be fixed in the future with an update to maintainer-tools.
agoose77
left a comment
There was a problem hiding this comment.
LGTM! We might need to revisit this with the changes needed for JupyterLab 4, but this is a good first step!
|
🚀 |
This enables local images to work in the markdown preview.