Skip to content

Commit

Permalink
fixing resources paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfunley committed Nov 5, 2024
1 parent ff97ebb commit 1442623
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions keynote_export/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
from reportlab.pdfgen import canvas
from reportlab.platypus import Paragraph

sf = TTFont("SanFrancisco", "resources/SanFrancisco-Regular.ttf")
RESOURCES = os.path.join(os.path.dirname(__file__), "resources")

sf = TTFont("SanFrancisco", f"{RESOURCES}/SanFrancisco-Regular.ttf")
pdfmetrics.registerFont(sf)


Expand Down Expand Up @@ -131,7 +133,7 @@ def generate_html(opts, notes):
def imgpath(s):
return s.replace(opts.outdir + "/", "")

e = Environment(loader=FileSystemLoader("resources"))
e = Environment(loader=FileSystemLoader(RESOURCES))
t = e.get_template("site.jinja")

s = t.render(
Expand All @@ -147,7 +149,7 @@ def imgpath(s):
open(outfile, "w").write(s)

shutil.copyfile(
"resources/presentation.css",
f"{RESOURCES}/presentation.css",
os.path.join(opts.outdir, "presentation.css"),
)

Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keynote_export"
version = "0.1.2"
version = "0.1.3"
description = ""
authors = ["Dan McKinley <[email protected]>"]
repository = "https://github.com/mcfunley/better-keynote-export"
Expand All @@ -12,6 +12,9 @@ keynote-export = "keynote_export:main"
[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
keynote_export = ["resources/*"]

[tool.poetry.dependencies]
python = "^3.12"
jinja2 = "^3.1.4"
Expand Down

0 comments on commit 1442623

Please sign in to comment.