mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-09-19 12:44:11 +08:00
chore(lib): do not include reversed files in HTML assets (#336)
* chore(lib): do not include reversed files in HTML assets * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Modified the internal logic to simplify adding configuration options.
|
- Modified the internal logic to simplify adding configuration options.
|
||||||
[#321](https://github.com/jeertmans/manim-slides/pull/321)
|
[#321](https://github.com/jeertmans/manim-slides/pull/321)
|
||||||
|
- Remove `reversed` file assets when exporting to HTML, as it was not used.
|
||||||
|
[#336](https://github.com/jeertmans/manim-slides/pull/336)
|
||||||
|
|
||||||
(v5.1-chore)=
|
(v5.1-chore)=
|
||||||
### Chore
|
### Chore
|
||||||
|
@ -305,7 +305,9 @@ class PresentationConfig(BaseModel): # type: ignore[misc]
|
|||||||
with open(path, "w") as f:
|
with open(path, "w") as f:
|
||||||
f.write(self.model_dump_json(indent=2))
|
f.write(self.model_dump_json(indent=2))
|
||||||
|
|
||||||
def copy_to(self, folder: Path, use_cached: bool = True) -> "PresentationConfig":
|
def copy_to(
|
||||||
|
self, folder: Path, use_cached: bool = True, include_reversed: bool = True
|
||||||
|
) -> "PresentationConfig":
|
||||||
"""Copy the files to a given directory."""
|
"""Copy the files to a given directory."""
|
||||||
for slide_config in self.slides:
|
for slide_config in self.slides:
|
||||||
file = slide_config.file
|
file = slide_config.file
|
||||||
@ -320,7 +322,7 @@ class PresentationConfig(BaseModel): # type: ignore[misc]
|
|||||||
if not use_cached or not dest.exists():
|
if not use_cached or not dest.exists():
|
||||||
shutil.copy(file, dest)
|
shutil.copy(file, dest)
|
||||||
|
|
||||||
if not use_cached or not rev_dest.exists():
|
if include_reversed and (not use_cached or not rev_dest.exists()):
|
||||||
shutil.copy(rev_file, rev_dest)
|
shutil.copy(rev_file, rev_dest)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
@ -396,7 +396,7 @@ class RevealJS(Converter):
|
|||||||
full_assets_dir.mkdir(parents=True, exist_ok=True)
|
full_assets_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
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, include_reversed=False)
|
||||||
|
|
||||||
dest.parent.mkdir(parents=True, exist_ok=True)
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user