diff --git a/manim_slides/convert.py b/manim_slides/convert.py index 774f7998..3dd33b4f 100644 --- a/manim_slides/convert.py +++ b/manim_slides/convert.py @@ -430,7 +430,9 @@ def prefix(i: int) -> str: dest.parent.mkdir(parents=True, exist_ok=True) with open(dest, "w") as f: - revealjs_template = Template(self.load_template()) + revealjs_template = Template( + self.load_template(), trim_blocks=True, lstrip_blocks=True + ) options = self.dict() options["assets_dir"] = assets_dir diff --git a/manim_slides/templates/revealjs.html b/manim_slides/templates/revealjs.html index ee4256e1..1643fd59 100644 --- a/manim_slides/templates/revealjs.html +++ b/manim_slides/templates/revealjs.html @@ -19,82 +19,75 @@
- {%- for presentation_config in presentation_configs -%} - {% set outer_loop = loop %} - {%- for slide_config in presentation_config.slides -%} - {%- if data_uri -%} + {% for presentation_config in presentation_configs %} + {%- set outer_loop = loop -%} + {% for slide_config in presentation_config.slides %} + {% if data_uri %} {% set file = file_to_data_uri(slide_config.file) %} - {%- else -%} + {% else %} {% set file = assets_dir / slide_config.file.name %} - {%- endif -%} + {% endif %}
- {% if slide_config.notes != "" -%} + {% endif %} + > + {% if slide_config.notes != "" %} - {%- endif %} + {% endif %}
- {%- endfor -%} - {%- endfor -%} + {% endfor %} + {% endfor %}
- - {% if has_notes -%} + {% if has_notes %} - {%- endif -%} + {% endif %} - - {% if env['READTHEDOCS'] -%} - - {%- endif %} + {% if env['READTHEDOCS'] %} + + {% endif %}