branch: elpa/typst-ts-mode
commit 07cf3bcc89bbfda870aa6bb5bb55b0a771593f6b
Author: Valentino Slavkin <[email protected]>
Commit: Valentino Slavkin <[email protected]>
Added function `typst-ts-preview`
Using browser-url, should find a better, more customizable, alternative
---
typst-ts-compile.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/typst-ts-compile.el b/typst-ts-compile.el
index c9f0538bed..a447550e9f 100644
--- a/typst-ts-compile.el
+++ b/typst-ts-compile.el
@@ -118,6 +118,12 @@ Assuming the compile output file name is in default style."
(interactive)
(typst-ts-compile t))
+;;;###autoload
+(defun typst-ts-preview ()
+ "Preview the current typst document output."
+ (browse-url (typst-ts-compile-get-result-pdf-filename #'current-buffer))
+ )
+
(defvar typst-ts-compilation-mode-error
(cons (rx bol "error:" (+ not-newline) "\n" (+ blank) "┌─ "
(group (+ not-newline)) ":" ;; file