mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-21 04:26:40 +08:00
fix(cli/convert): ensure dest path can be written (#262)
Fixes the issue that non-existing parent(s) in the dest path would raise an error.
This commit is contained in:
@ -65,6 +65,9 @@ In an effort to better document changes, this CHANGELOG document is now created.
|
|||||||
[#253](https://github.com/jeertmans/manim-slides/discussions/253), caused by
|
[#253](https://github.com/jeertmans/manim-slides/discussions/253), caused by
|
||||||
Python 3.11's change in how `Enum` work.
|
Python 3.11's change in how `Enum` work.
|
||||||
[#257](https://github.com/jeertmans/manim-slides/pull/257).
|
[#257](https://github.com/jeertmans/manim-slides/pull/257).
|
||||||
|
- Fixed potential non-existing parent path issue in
|
||||||
|
`manim convert`'s destination path.
|
||||||
|
[#262](https://github.com/jeertmans/manim-slides/pull/262)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -378,6 +378,8 @@ class RevealJS(Converter):
|
|||||||
for presentation_config in self.presentation_configs:
|
for presentation_config in self.presentation_configs:
|
||||||
presentation_config.copy_to(full_assets_dir)
|
presentation_config.copy_to(full_assets_dir)
|
||||||
|
|
||||||
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
with open(dest, "w") as f:
|
with open(dest, "w") as f:
|
||||||
revealjs_template = Template(self.load_template())
|
revealjs_template = Template(self.load_template())
|
||||||
|
|
||||||
@ -434,6 +436,8 @@ class PDF(Converter):
|
|||||||
read_image_from_video_file(slide_config.file, self.frame_index)
|
read_image_from_video_file(slide_config.file, self.frame_index)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
images[0].save(
|
images[0].save(
|
||||||
dest,
|
dest,
|
||||||
"PDF",
|
"PDF",
|
||||||
@ -524,6 +528,7 @@ class PowerPoint(Converter):
|
|||||||
if self.auto_play_media:
|
if self.auto_play_media:
|
||||||
auto_play_media(movie, loop=slide_config.is_loop())
|
auto_play_media(movie, loop=slide_config.is_loop())
|
||||||
|
|
||||||
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||||
prs.save(dest)
|
prs.save(dest)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user