ionelmc / python-darkslide

Generate HTML5 slideshows from markdown, ReST, or textile
http://ionelmc.github.io/python-darkslide/
Apache License 2.0
97 stars 22 forks source link

embedded javascript of asciinema not loaded after slide 5 #21

Closed jflalande closed 4 years ago

jflalande commented 4 years ago

Hello,

I am trying to embed terminals capture using asciinema. I use the raw html directive. It is working on the first slides, but after slide 5, the javascript seems not executed or seems to enter in conflict with the code that animate slides.

I produced a MWE:

Slide 1
-------

ok

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

----

Slide 2
-------

ok

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

----

Slide 3
-------

ok

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

----

Slide 4
-------

ok

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

----

Slide 5
-------

not ok (not loaded)

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

----

Slide 6
-------

not ok (not loaded)

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

----

Slide 7
-------

not ok (not loaded)

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

----

Slide 8
-------

not ok (not loaded)

.. raw:: html

  <center>
  <script id="asciicast-eOJZrTaTu9jOO6Xe4m2tvnZsw" src="https://asciinema.org/a/eOJZrTaTu9jOO6Xe4m2tvnZsw.js" async></script>
  </center>

When laoding the document at slide 1 in firefox or chrome, all is going fine until slide 5 that does not embed the terminal fragment. I see no obvious error in the javascript console.

Any idea about this issue ?

jflalande commented 4 years ago

I found a workaround, rebuilding the iframe element and the CSS:

.. raw:: html

   <iframe id="asciicast-iframe" 
   src="https://asciinema.org/a/X4Vhe4fAZ0gHeQeQBA560Gzrm/embed?size=medium&rows=23">
   </iframe>

and the CSS:

#asciicast-iframe {
overflow: visible;
margin-left: auto;
margin-right: auto;
border: 0;
display: inline-block;
width: 885px;
height: 100%;
float: none;
}