mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-07-02 21:07:00 +08:00
fix(rtd): remove flyout in iframes (#367)
* fix(rtd): remove flyout in iframes * fix(rtd): remove dirhtml and default to html Because dirhtml seems to have issues with iframes * fix(html): correct css style
This commit is contained in:
@ -10,7 +10,7 @@ build:
|
|||||||
post_install:
|
post_install:
|
||||||
- ipython kernel install --name "manim-slides" --user
|
- ipython kernel install --name "manim-slides" --user
|
||||||
sphinx:
|
sphinx:
|
||||||
builder: dirhtml
|
builder: html
|
||||||
configuration: docs/source/conf.py
|
configuration: docs/source/conf.py
|
||||||
fail_on_warning: true
|
fail_on_warning: true
|
||||||
python:
|
python:
|
||||||
|
@ -416,6 +416,7 @@ class RevealJS(Converter):
|
|||||||
file_to_data_uri=file_to_data_uri,
|
file_to_data_uri=file_to_data_uri,
|
||||||
get_duration_ms=get_duration_ms,
|
get_duration_ms=get_duration_ms,
|
||||||
has_notes=has_notes,
|
has_notes=has_notes,
|
||||||
|
env=os.environ,
|
||||||
**options,
|
**options,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -316,28 +316,36 @@
|
|||||||
hideCursorTime: {{ hide_cursor_time }}
|
hideCursorTime: {{ hide_cursor_time }}
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if data_uri %}
|
{% if data_uri -%}
|
||||||
// Fix found by @t-fritsch on GitHub
|
// Fix found by @t-fritsch on GitHub
|
||||||
// see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-6651475.
|
// see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-6651475.
|
||||||
function fixBase64VideoBackground(event) {
|
function fixBase64VideoBackground(event) {
|
||||||
// event.previousSlide, event.currentSlide, event.indexh, event.indexv
|
// event.previousSlide, event.currentSlide, event.indexh, event.indexv
|
||||||
if (event.currentSlide.getAttribute('data-background-video')) {
|
if (event.currentSlide.getAttribute('data-background-video')) {
|
||||||
const background = Reveal.getSlideBackground(event.indexh, event.indexv),
|
const background = Reveal.getSlideBackground(event.indexh, event.indexv),
|
||||||
video = background.querySelector('video'),
|
video = background.querySelector('video'),
|
||||||
sources = video.querySelectorAll('source');
|
sources = video.querySelectorAll('source');
|
||||||
|
|
||||||
sources.forEach((source, i) => {
|
sources.forEach((source, i) => {
|
||||||
const src = source.getAttribute('src');
|
const src = source.getAttribute('src');
|
||||||
if(src.match(/^data:video.*;base64$/)) {
|
if(src.match(/^data:video.*;base64$/)) {
|
||||||
const nextSrc = sources[i+1]?.getAttribute('src');
|
const nextSrc = sources[i+1]?.getAttribute('src');
|
||||||
video.setAttribute('src', `${src},${nextSrc}`);
|
video.setAttribute('src', `${src},${nextSrc}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reveal.on( 'ready', fixBase64VideoBackground );
|
}
|
||||||
Reveal.on( 'slidechanged', fixBase64VideoBackground );
|
Reveal.on( 'ready', fixBase64VideoBackground );
|
||||||
{% endif %}
|
Reveal.on( 'slidechanged', fixBase64VideoBackground );
|
||||||
|
{%- endif %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{% if env['READTHEDOCS'] -%}
|
||||||
|
<style>
|
||||||
|
readthedocs-flyout, readthedocs-notification {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{%- endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user