mfontanini / presenterm

A markdown terminal slideshow tool
https://mfontanini.github.io/presenterm/
BSD 2-Clause "Simplified" License
1.35k stars 34 forks source link

'presenterm-export' execution failed when exporting minimal presentation #98

Closed mocdaniel closed 10 months ago

mocdaniel commented 10 months ago

This is a follow-up to #97.

presenterm version: 0.4.0 presenterm-export version: 0.2.0 OS: MacOS Sonoma 14.2.1 Architecture: Apple Silicon Used Terminal: iTerm2

Installed Python modules:

➜ pip list
Package           Version
----------------- -------
ansi2html         1.8.0
Brotli            1.1.0
cffi              1.16.0
cssselect2        0.7.0
dataclass-wizard  0.22.2
fonttools         4.47.0
html5lib          1.1
libtmux           0.23.2
Pillow            10.1.0
pip               23.3.1
presenterm-export 0.2.0
pycparser         2.21
pydyf             0.8.0
pyphen            0.14.0
setuptools        68.2.2
six               1.16.0
tinycss2          1.2.1
weasyprint        60.1
webencodings      0.5.1
zopfli            0.2.3

When exporting the following presentation, I end up with the stacktrace below:

---
title: Some Title
sub_title: Some Subtitle
author: Daniel Bodky
theme:
  name: dark
  override:
    footer:
      style: template
      left: "@d_bodky"
      center: "{current_slide} / {total_slides}"
      right: Hello World!
---

# Hello
![Doge](./doge.png)
➜ presenterm -e presentation.md
Writing temporary files into /var/folders/5k/zvc1ysc154988bw5xs4y_9w00000gn/T/tmp07u5k8e9
Running presentation to capture slide...
Captured 1 slides so far...
Captured 2 slides so far...
Captured 2 slides
Converting slides to HTML...
Replacing images...
Transforming color block #ffbad3 into image /Users/daniel/repositories/private/presenterm-test/doge.png
'presenterm-export' execution failed:
Traceback (most recent call last):
  File "/Users/daniel/repositories/private/presenterm-test/.venv/bin/presenterm-export", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/daniel/repositories/private/presenterm-test/.venv/lib/python3.11/site-packages/presenterm_export/cli.py", line 111, in main
    run(args, metadata)
  File "/Users/daniel/repositories/private/presenterm-test/.venv/lib/python3.11/site-packages/presenterm_export/cli.py", line 58, in run
    presentation_html = processor.replace_final_images(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/daniel/repositories/private/presenterm-test/.venv/lib/python3.11/site-packages/presenterm_export/image.py", line 39, in replace_final_images

Edit 1: The referenced image doge.png is taken from this repository's examples folder. Edit 2: Added the used terminal, in case it got to do with how the image(s) get rendered.

mfontanini commented 10 months ago

Thanks for the details! This is fixed in master. If you don't want to pull from source you can fix it yourself by running unset LC_TERMINAL before running presenterm -e.

mfontanini commented 10 months ago

I take it back, this is not fixed yet. The LC_TERMINAL thing will fix it though so you can do that temporarily if I don't get to fix this now.

mfontanini commented 10 months ago

Okay it should be fixed 4reals now. I'll try to test it on a mac later.

mfontanini commented 10 months ago

I can confirm it's fixed. I'll probably release version 0.4.1 with this fix soon.