Running a IIIF server in Streamlit

Has anyone been able to get a IIIF server running in Streamlit? E.g., Mirador or Universal Viewer? (IIIF Viewers β€” IIIF | International Image Interoperability Framework)

One that I tried in particular is the diva.js viewer, as it seemed one of the most straightforward. ( From the instructions in github (GitHub - DDMAL/diva.js: πŸ“š IIIF-compatible document image viewer), I included the following as an html block in Streamlit (using unsafe_allow_html)

    <link rel="stylesheet" href="//" />
    <script src="//"></script>
    <div id="diva-wrapper"></div>
        let diva = new Diva('diva-wrapper', {
            objectData: ""
            // possible settings

But nothing showed up. (Note the above example includes a dummy IIIF manifest. I did use an active one:

I’m pretty good with Python and HTML, but my JS knowledge is pretty low. I looked through the Streamlit forums but didn’t find any references. Has anyone else worked with this successfully (or otherwise)?

Hi @ewolfe1

Instead of using st.markdown() with the unsafe_allow_html parameter, have you tried using st.components.v1.html() to embed the HTML block?

More info from the Docs page:

There’s also a resource on IIIF here as well that you can check out for potential Python libraries or APIs with this functionality: