Skip to content

Commit

Permalink
Added support for Windows tools
Browse files Browse the repository at this point in the history
  • Loading branch information
MartenBE committed Sep 14, 2024
1 parent 70ae6f2 commit 3105e00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mkslides_reveal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_plugins(self) -> list | None:
return self.__get("plugins")

def merge_config_from_file(self, config_path: Path) -> None:
with config_path.open() as f:
with config_path.open(encoding="utf-8-sig") as f:
new_config = yaml.safe_load(f)

self.__config = self.__recursive_merge(self.__config, new_config)
Expand Down
6 changes: 4 additions & 2 deletions src/mkslides_reveal/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@
VERSION = metadata.version("mkslides_reveal")

REVEALJS_VERSION = None
with REVEALJS_RESOURCE.joinpath("package.json").open() as f:
with REVEALJS_RESOURCE.joinpath("package.json").open(encoding="utf-8-sig") as f:
REVEALJS_VERSION = json.load(f)["version"]

HIGHLIGHTJS_THEMES_VERSION = None
with HIGHLIGHTJS_RESOURCE.joinpath("build", "package.json").open() as f:
with HIGHLIGHTJS_RESOURCE.joinpath("build", "package.json").open(
encoding="utf-8-sig"
) as f:
HIGHLIGHTJS_THEMES_VERSION = json.load(f)["version"]
2 changes: 1 addition & 1 deletion src/mkslides_reveal/markupgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __process_markdown_file(

# Retrieve the frontmatter metadata and the markdown content

content = md_file.read_text()
content = md_file.read_text(encoding="utf-8-sig")
metadata, markdown = frontmatter.parse(content)

# Get the relative path of reveal.js
Expand Down

0 comments on commit 3105e00

Please sign in to comment.