Typst live preview
This commit is contained in:
19
config.el
19
config.el
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
(use-package! typst-ts-mode
|
(use-package! typst-ts-mode
|
||||||
:custom
|
:custom
|
||||||
(typst-ts-watch-options "--open")
|
;; (typst-ts-watch-options "--open")
|
||||||
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
|
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
|
||||||
(typst-ts-mode-enable-raw-blocks-highlight t)
|
(typst-ts-mode-enable-raw-blocks-highlight t)
|
||||||
:config
|
:config
|
||||||
@@ -50,3 +50,20 @@
|
|||||||
,(eglot-alternatives `(,typst-ts-lsp-download-path
|
,(eglot-alternatives `(,typst-ts-lsp-download-path
|
||||||
"tinymist"
|
"tinymist"
|
||||||
"typst-lsp"))))))
|
"typst-lsp"))))))
|
||||||
|
|
||||||
|
(use-package! websocket)
|
||||||
|
(use-package! typst-preview
|
||||||
|
;; :load-path "path/to/typst-preview.el" ;; if installed manually
|
||||||
|
:init
|
||||||
|
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
|
||||||
|
;; (setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
|
||||||
|
|
||||||
|
:custom
|
||||||
|
(typst-preview-browser "default") ; this is the default option; other options are `eaf-browser' or `xwidget'.
|
||||||
|
(typst-preview-invert-colors "auto") ; invert colors depending on system theme
|
||||||
|
(typst-preview-executable "tinymist") ; path to tinymist binary (relative or absolute)
|
||||||
|
(typst-preview-partial-rendering t) ; enable partial rendering
|
||||||
|
|
||||||
|
:config
|
||||||
|
(define-key typst-preview-mode-map (kbd "C-c C-j") 'typst-preview-send-position)
|
||||||
|
(define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode))
|
||||||
|
|||||||
28
config.org
28
config.org
@@ -79,7 +79,7 @@ Configuration
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package! typst-ts-mode
|
(use-package! typst-ts-mode
|
||||||
:custom
|
:custom
|
||||||
(typst-ts-watch-options "--open")
|
;; (typst-ts-watch-options "--open")
|
||||||
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
|
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
|
||||||
(typst-ts-mode-enable-raw-blocks-highlight t)
|
(typst-ts-mode-enable-raw-blocks-highlight t)
|
||||||
:config
|
:config
|
||||||
@@ -96,3 +96,29 @@ Configuration
|
|||||||
"tinymist"
|
"tinymist"
|
||||||
"typst-lsp"))))))
|
"typst-lsp"))))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
**** Live-preview
|
||||||
|
#+begin_src emacs-lisp :tangle packages.el
|
||||||
|
(package! typst-preview
|
||||||
|
:recipe (:host github :repo "havarddj/typst-preview.el"))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
***** Config
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package! websocket)
|
||||||
|
(use-package! typst-preview
|
||||||
|
;; :load-path "path/to/typst-preview.el" ;; if installed manually
|
||||||
|
:init
|
||||||
|
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
|
||||||
|
;; (setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
|
||||||
|
|
||||||
|
:custom
|
||||||
|
(typst-preview-browser "default") ; this is the default option; other options are `eaf-browser' or `xwidget'.
|
||||||
|
(typst-preview-invert-colors "auto") ; invert colors depending on system theme
|
||||||
|
(typst-preview-executable "tinymist") ; path to tinymist binary (relative or absolute)
|
||||||
|
(typst-preview-partial-rendering t) ; enable partial rendering
|
||||||
|
|
||||||
|
:config
|
||||||
|
(define-key typst-preview-mode-map (kbd "C-c C-j") 'typst-preview-send-position)
|
||||||
|
(define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode))
|
||||||
|
#+end_src
|
||||||
|
|||||||
@@ -12,3 +12,6 @@
|
|||||||
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
|
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
|
||||||
|
|
||||||
(package! typst-ts-mode :recipe (:host codeberg :repo "meow_king/typst-ts-mode"))
|
(package! typst-ts-mode :recipe (:host codeberg :repo "meow_king/typst-ts-mode"))
|
||||||
|
|
||||||
|
(package! typst-preview
|
||||||
|
:recipe (:host github :repo "havarddj/typst-preview.el"))
|
||||||
|
|||||||
Reference in New Issue
Block a user