Closed bgriffen closed 1 year ago
Unfortunately, I don't think mkdocs-jupyter supports rendering ipywidgets. See https://github.com/danielfrg/mkdocs-jupyter/issues/67. The mkdocs-jupyter maintainer never responded to the request, so I closed it.
For the leafmap mkdocs, I use folium to render it. See https://github.com/opengeos/leafmap/blob/master/leafmap/__init__.py#L22
Was scratching my head on this a bit as well but this issue/question clarified things. Thank you.
Also, a helpful resource here is understanding how to select from the different backends of Leafmap.
For the solution above make sure that the environment variable is set before importing leafmap
:
import os
os.environ['USE_MKDOCS'] = 'True'
import leafmap
m = leafmap.Map()
m
Or you can select & set the folium backend directly:
import leafmap.foliumap
m2 = leafmap.foliumap.Map()
m2
We get the same results for both. And renders nicely as quarto html output as well.
Description
I am trying to create my own mkdocs page and all is running well. I then wanted to render the
leafmap
maps from the Jupyter notebooks exactly as it is here. I thought by lifting the relevant parts of themkdocs
yaml config forleafmap
thinking I would be able to render Jupyter notebooks but not having any success. The text/code blocks update but no map renders.Source code
mkdocs.yml:
Just starting with even a basic notebook import/display as follows:
My result on my mkdocs page as such:
Was there additional things in the
mkdocs.yml
that I'm missing or something else to get the map to display? I tried the other feature request in 2021 related to this but didn't lead anywhere. Any help appreciated. Thank you.