mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-20 20:16:30 +08:00
feat(convert/html): inline CSS and JS with convert --one_file --offline (#505)
* feat: Inline CSS and JS by default with --offline * chore(fmt): auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore: Add test * Add one_file parameter * chore(fmt): auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix lint * Fix typo * Fix typo * Fix IPython magic doc * Update manim_slides/convert.py Co-authored-by: Jérome Eertmans <jeertmans@icloud.com> * Add test for one_file=true * chore(fmt): auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update manim_slides/convert.py Co-authored-by: Jérome Eertmans <jeertmans@icloud.com> * Update manim_slides/convert.py Co-authored-by: Jérome Eertmans <jeertmans@icloud.com> * Update docs/source/reference/sharing.md Co-authored-by: Jérome Eertmans <jeertmans@icloud.com> * Update manim_slides/convert.py Co-authored-by: Jérome Eertmans <jeertmans@icloud.com> * chore(fmt): auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add changelog and tests * Fix IPython magic * Update docs/source/faq.md * Update CHANGELOG.md --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
{%- for presentation_config in presentation_configs -%}
|
||||
{% set outer_loop = loop %}
|
||||
{%- for slide_config in presentation_config.slides -%}
|
||||
{%- if data_uri -%}
|
||||
{%- if one_file -%}
|
||||
{% set file = file_to_data_uri(slide_config.file) %}
|
||||
{%- else -%}
|
||||
{% set file = assets_dir / slide_config.file.name %}
|
||||
@ -315,7 +315,7 @@
|
||||
hideCursorTime: {{ hide_cursor_time }}
|
||||
});
|
||||
|
||||
{% if data_uri %}
|
||||
{% if one_file %}
|
||||
// Fix found by @t-fritsch on GitHub
|
||||
// see: https://github.com/hakimel/reveal.js/discussions/3362#discussioncomment-6651475.
|
||||
function fixBase64VideoBackground(event) {
|
||||
|
@ -102,7 +102,7 @@ Questions related to `manim-slides convert [SCENES]... output.html`.
|
||||
|
||||
### I moved my `.html` file and it stopped working
|
||||
|
||||
If you did not specify `-cdata_uri=true` when converting,
|
||||
If you did not specify `--one-file` (or `-cone_file=true`) when converting,
|
||||
then Manim Slides generated a folder containing all
|
||||
the video files, in the same folder as the HTML
|
||||
output. As the path to video files is a relative path,
|
||||
|
@ -137,9 +137,10 @@ and it there to preserve the original aspect ratio (16:9).
|
||||
|
||||
### Sharing ONE HTML file
|
||||
|
||||
If you set the `data_uri` option to `true` (with `-cdata_uri=true`),
|
||||
all animations will be data URI encoded, making the HTML a self-contained
|
||||
presentation file that can be shared on its own.
|
||||
If you set the `--one-file` flag, all animations will be data URI encoded,
|
||||
making the HTML a self-contained presentation file that can be shared
|
||||
on its own. If you also set the `--offline` flag, the JS and CSS files will
|
||||
be included in the HTML file as well.
|
||||
|
||||
### Over the internet
|
||||
|
||||
|
Reference in New Issue
Block a user