iframequartoreveal.js

quarto markdown to revealjs or html: Desmos embedded iframes not loading


I'm making a slide deck in markdown, that I convert to a revealjs presentation with quarto. I want to embed iframes from Desmos, to show some nice interactive graphs. The iframes are not loading. How can I make them work?

Minimal reproducible example (render with quarto render):

---
format:
  revealjs:
    embed-resources: true
---

#### A cool interactive graph

<iframe src="https://www.desmos.com/calculator/8wiixd9ks4?embed" width="500" height="500" style="border: 1px solid #ccc" frameborder=0></iframe>

Solution

  • The problem comes from the embed-resources option: quarto tries to include the complete external webpage in the document, which is not possible in the case of Desmos.

    This can be solved by adding the data-external="1" attribute on your iframes (see reference in the quarto documentation).

    ---
    format:
      revealjs:
        embed-resources: true
    ---
    
    #### A cool interactive graph
    
    <iframe data-external="1" src="https://www.desmos.com/calculator/8wiixd9ks4?embed" width="500" height="500" style="border: 1px solid #ccc" frameborder=0></iframe>