Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "typst_pyimage"
version = "0.0.4"
version = "0.0.5"
description = "Typst extension, adding support for generating figures using inline Python code"
readme = "README.md"
requires-python = "~=3.8"
Expand Down
1 change: 1 addition & 0 deletions typst_pyimage/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def _watch_wrapper(args):
"-a",
"--extra-args",
type=str,
default="",
help="Extra arguments to be passed to typst",
)

Expand Down
8 changes: 2 additions & 6 deletions typst_pyimage/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,9 @@ def _initial(

def watch(
filename: Union[str, pathlib.Path],
extra_args: Optional[list[str]] = None,
extra_args: list[str],
timeout_s: Optional[int] = None,
):
if extra_args is None:
extra_args = []
figcache = {}
contentcache = {}
filepath, dirpath, init_code, init_scope = _initial(
Expand Down Expand Up @@ -190,8 +188,6 @@ def watch(
process.kill()


def compile(filename: Union[str, pathlib.Path], extra_args: Optional[list[str]] = None):
if extra_args is None:
extra_args = []
def compile(filename: Union[str, pathlib.Path], extra_args: list[str]):
filepath, _, _, _ = _initial(filename, figcache=None, contentcache=None)
subprocess.run(["typst", "compile"] + extra_args + [str(filepath)])