Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
123ccbb
Adding direction keyword to config and nextSlide function
daughterOfSpring Feb 20, 2026
f83e6b1
Fixing issue with direction keyword being undeclared
daughterOfSpring Feb 20, 2026
e77700b
Adding vertical behavior to revealjs
daughterOfSpring Feb 20, 2026
0b0fd50
making horizontal behavior default
daughterOfSpring Feb 20, 2026
f417f3b
Refactoring how the next_slide method communicates directionality to …
daughterOfSpring Feb 20, 2026
aae25c7
chore(fmt): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 20, 2026
5e723b4
Adding directions explicitly to config methods
daughterOfSpring Feb 20, 2026
e926c50
Merge remote-tracking branch 'origin/main'
daughterOfSpring Feb 20, 2026
ef71733
chore(fmt): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 20, 2026
f6462a4
Refactoring logic for creating vertical slides
daughterOfSpring Feb 20, 2026
d706012
Refactoring for precommit checks
daughterOfSpring Feb 20, 2026
2aa8609
chore(fmt): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 20, 2026
a2978c6
Refactoring for precommit checks
daughterOfSpring Feb 20, 2026
5db9726
Merge branch 'main' of https://github.com/daughterOfSpring/manim-slides
daughterOfSpring Feb 20, 2026
aaa66e0
Removing direction from from_base_slide_config_and_animation_indices…
daughterOfSpring Feb 20, 2026
122b1fe
Fixing multiple values for direction
daughterOfSpring Feb 20, 2026
a0380a0
Cleaning up changes
daughterOfSpring Feb 20, 2026
289cf01
Removing extra direction values
daughterOfSpring Feb 20, 2026
d502667
chore(fmt): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 20, 2026
3291db8
removed circular direction assignment
daughterOfSpring Feb 20, 2026
1513ca7
removing direction behavior from next slide function
daughterOfSpring Feb 21, 2026
f21318f
chore(fmt): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 21, 2026
151d462
Removing debugging comment from revealjs
daughterOfSpring Feb 21, 2026
9eba0d1
Update manim_slides/slide/base.py
daughterOfSpring Feb 22, 2026
2b6752f
Adding examples and explanation for vertical slides.
daughterOfSpring Feb 22, 2026
459497d
chore(fmt): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 22, 2026
56e19ba
Update docs/source/reference/html.md
daughterOfSpring Feb 22, 2026
e9e2b2b
Link for revealjs documentation on vertical slides
daughterOfSpring Feb 22, 2026
4597a1c
Update docs/source/reference/html.md
daughterOfSpring Feb 22, 2026
4c4f85a
Update docs/source/reference/html.md
daughterOfSpring Feb 22, 2026
a5ac727
updating changelog
daughterOfSpring Feb 22, 2026
9f4102e
Apply suggestion from @jeertmans
jeertmans Feb 23, 2026
db5e526
Apply suggestion from @jeertmans
jeertmans Feb 23, 2026
e177ee8
Apply suggestion from @jeertmans
jeertmans Feb 23, 2026
fe02687
Apply suggestion from @jeertmans
jeertmans Feb 23, 2026
de79a84
Apply suggestion from @jeertmans
jeertmans Feb 23, 2026
3864bca
Apply suggestion from @jeertmans
jeertmans Feb 23, 2026
4b7e6cf
Adding angle brackets to link
daughterOfSpring Feb 23, 2026
b1f446e
Apply suggestion from @jeertmans
jeertmans Feb 24, 2026
7d99e75
Moving added feature to unreleased
daughterOfSpring Feb 24, 2026
a03ff2a
Apply suggestion from @jeertmans
jeertmans Feb 24, 2026
78162e7
Apply suggestion from @jeertmans
jeertmans Feb 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(unreleased)=
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.5.4...HEAD)

### Added

- Added vertical slide implementation to html exports of presentations. [@DaughterOfSpring](https://github.com/daughterOfSpring) [#602](https://github.com/jeertmans/manim-slides/pull/602)

(v5.5.4)=
## [v5.5.4](https://github.com/jeertmans/manim-slides/compare/v5.5.3...v5.5.4)

Expand Down
66 changes: 66 additions & 0 deletions docs/source/reference/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,72 @@ or printed with the `--show-template` option.
If you wish to use another template, you can do so with the
`--use-template FILE` option.

## Vertical Slides

Slides default to a "horizontal" arrangement by default. This means that each
slide follows the next in a linear progression. If you instead wish to add
an additional dimension to your slides and have "vertical" groupings under a
given "horizontal" slide, you may pass the keyword argument "direction" to the
{meth}`next_slide<manim_slides.slide.Slide.next_slide>`
method and give it the argument "vertical". The "horizontal" slides
will be the main progression of your presentation accessible by tabbing left
or right using those arrow keys. For "vertical" slides you move to the "horizontal"
parent slide and use the up and down keys to navigate through the slides that are
grouped under the initial slide. You may still use the left/right navigation to
move from any slide in the vertical stack to the next "horizontal" slide.

In the following example we have only the linear "horizontal" slides.
Note that no direction argument is passed to
{meth}`self.next_slide()<manim_slides.slide.Slide.next_slide>`.

```{eval-rst}
.. manim-slides:: HorizontalSlides
:config_options: slide_number=true

from manim import *
from manim_slides import Slide

class HorizontalSlides(Slide):
def construct(self):
circle = Circle(radius=3, color=BLUE)
dot = Dot()

self.play(GrowFromCenter(circle))

self.next_slide(loop=True)
self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
self.next_slide()

self.play(dot.animate.move_to(ORIGIN))
```

In this example the second slide is a "vertical" slide so the left right progression
moves from slide 1 to slide 3, while to access slide 2 you must be on slide 1 and
press the down key.

```{eval-rst}
.. manim-slides:: VerticalAndHorizontalSlides
:config_options: slide_number=true

from manim import *
from manim_slides import Slide

class VerticalAndHorizontalSlides(Slide):
def construct(self):
circle = Circle(radius=3, color=BLUE)
dot = Dot()

self.play(GrowFromCenter(circle))

self.next_slide(direction="vertical", loop=True)
self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
self.next_slide(direction="vertical")

self.play(dot.animate.move_to(ORIGIN))
```

For more information about vertical slides see <https://revealjs.com/vertical-slides/>.

## More about HTML Slides

You can read more about HTML slides in the [sharing](/reference/sharing) section.
3 changes: 2 additions & 1 deletion manim_slides/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from inspect import Parameter, signature
from pathlib import Path
from textwrap import dedent
from typing import Any, Callable, Optional
from typing import Any, Callable, Literal, Optional

import rtoml
from pydantic import (
Expand Down Expand Up @@ -162,6 +162,7 @@ class BaseSlideConfig(BaseModel): # type: ignore
dedent_notes: bool = True
skip_animations: bool = False
src: Optional[FilePath] = None
direction: Literal["horizontal", "vertical"] = "horizontal"

@classmethod
def wrapper(cls, arg_name: str) -> Callable[..., Any]:
Expand Down
6 changes: 6 additions & 0 deletions manim_slides/slide/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ def next_slide(

The video will be copied into the output folder, but no rescaling
is applied.
:param direction:
Optional variable used to set slide direction.

.. warning::

Only supported by ``manim-slides convert --to=html``.
:param kwargs:
Keyword arguments passed to
:meth:`Scene.next_section<manim.scene.scene.Scene.next_section>`,
Expand Down
15 changes: 15 additions & 0 deletions manim_slides/templates/revealjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,25 @@
<div class="reveal">
<div class="slides">
{% for presentation_config in presentation_configs -%}
{% set ns = namespace(open_stack=false) %}
{%- set outer_loop = loop %}
{% for slide_config in presentation_config.slides %}
{% if one_file %}
{% set file = file_to_data_uri(slide_config.file) %}
{% else %}
{% set file = assets_dir / (prefix(outer_loop.index0) + slide_config.file.name) %}
{% endif %}
{% if slide_config.direction == "vertical" %}
{% if not ns.open_stack %}
<section>
{% set ns.open_stack = true %}
{% endif %}
{% else %}
{% if ns.open_stack %}
</section>
{% set ns.open_stack = false %}
{% endif %}
{% endif %}
<section
data-background-size={{ background_size }}
data-background-color="{{ presentation_config.background_color }}"
Expand All @@ -45,6 +57,9 @@
{% endif %}
</section>
{% endfor %}
{% if ns.open_stack %}
</section>
{% endif %}
{% endfor %}
</div>
</div>
Expand Down