Skip to content
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

document or improve handling of _static when coming from jb1 #1250

Open
parmentelat opened this issue May 28, 2024 · 1 comment
Open

document or improve handling of _static when coming from jb1 #1250

parmentelat opened this issue May 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@parmentelat
Copy link
Contributor

foreword

I am coming from jb1/sphinx; for handling some types of media, I have had to - at some point in time at least, I've had no other choice than to - store some kinds of media under the _static folder, so as to ensure it would be part of the generated book

specifically I've gotten used to doing like that for at least

  • html documents (think e.g. folium-generated maps, or self-contained cheatsheets,...) that I want to include via an iframe
  • videos (I have seen the mystmd tool is much better equipped for handling them now, but in the perspective of a smooth transition it may make sense to mention them here)
  • and more generally everything that's a bit unconventional and that, again, we want to make sure to bundle with the output

my problem

let me focus on the html category for now; I had this guinea pig jb1 project here
https://jupyterlab-examples.readthedocs.io/en/main/1-05-iframes-nb.html#use-ipython-s-iframe-instead

and I don't know how to translate this into jb2
if I write e.g.
markdown ```{iframe} _static/cheatsheet.html ```
then I'm getting an iframe .. with inside a myst theme featuring a "Document not found"

ps: this is an attempt at replying to @choldgraf's request for clarification in
#1228 (comment)
sorry this is probably still rather confused but hopefully a little more helpful
please feel free to change this issue title, and to make it more specific if needed

@parmentelat parmentelat added the enhancement New feature or request label May 28, 2024
@rowanc1
Copy link
Member

rowanc1 commented May 28, 2024

Thanks @parmentelat -- your issue makes a lot of sense, and thanks for the descriptions of your current use case, very helpful. Happy to see that we have made some improvements on the videos. :)

This is a related issue:

Currently I don't think this is very possible in mystmd, we hash the output files to ensure all caches are busted, but that means the links are not stable, and the iframe doesn't look to the local filesystem at this point.

I think there are a few ways to go - (1) give a static directory similar to sphinx; (2) expand the argument of the iframe to allow local HTML files. I think that probably (2) is going to have problems, especially if there are any other assets that are loaded by the iframe, so (1) is probably the right way to go here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants