Skip to content

feat: add --temp-dir flag for configurable temp directory location#883

Open
de-abreu wants to merge 1 commit into
mfontanini:masterfrom
de-abreu:feat/add-temp-dir-flag
Open

feat: add --temp-dir flag for configurable temp directory location#883
de-abreu wants to merge 1 commit into
mfontanini:masterfrom
de-abreu:feat/add-temp-dir-flag

Conversation

@de-abreu

Copy link
Copy Markdown

Summary

Add a new --temp-dir CLI flag that allows users to specify where presenterm should create temporary directories when rendering typst and LaTeX content.

Problem

Presenterm creates temporary directories in the presentation file's directory when rendering typst/latex content. This fails when presentations are stored in read-only directories such as the nix store.

Solution

  • Add --temp-dir CLI flag to specify a custom temporary directory
  • When provided, temporary directories are created in the specified location
  • When not provided, the system temp directory is used (changed from presentation directory)

Changes

  • Added temp_dir field to ThirdPartyConfigs
  • Added --temp-dir CLI argument
  • Modified do_render_typst to use configured temp dir or system temp

Use Case

This is particularly useful for nix users who want to run presentations directly from the nix store:

presenterm --temp-dir /tmp /nix/store/.../presentation.md

Fixes rendering issues when running presenterm on presentations stored in read-only filesystems.

Add a new --temp-dir CLI flag that allows users to specify where
presenterm should create temporary directories when rendering typst
and LaTeX content.

This is useful when presentations are stored in read-only directories
such as the nix store, where the default behavior of creating temp
directories in the presentation's directory would fail.

When --temp-dir is provided, temporary directories are created in
the specified location. Otherwise, the system temp directory is used.

Fixes rendering issues when running presenterm on presentations
stored in read-only filesystems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant