the static files feature¶
as of 2026 june and myst 1.10, there is now a way to include static files in the mystmd output
so we’re going to use a static resource called folium.html that sits in the
source repo in _static/folium.html and that is declared as a static file in
myst.yml:
project:
static_files:
- _staticWith this setting:
I can now refer to the html file in the notebook with a URL like
/_static/folium.htmlNote that the initial
/is mandatoryAlso as far as I can tell, the resource is availble in a static build (
myst build) but not in a dev build (myst start)..
In the examples below we focus on rendering an iFrame, and we’ll use this folium-generated content as the source
raw HTML iframe: suboptimal !¶
use IPython’s IFrame instead¶
If you happen to use a Python kernel, this alternative seems to be the only way apparently to have control on both sizes; can’t center it though ?
from IPython.display import IFrame
IFrame("/_static/folium.html", "200px", "200px")mystmd iframe¶
likewise, no control on sizes in mystmd:
cannot set height (print error message)
and width is accepted but not honored apparently...