Enter-tainer / typst-preview

[DEPRECATED] Use tinymist instead

Home Page:https://Enter-tainer.github.io/typst-preview/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Export in slide mode

ntjess opened this issue · comments

Feature Request

Add an "Export in slide mode" feature to the VSCode command palette so that slides can be shared

Use Case

It is wonderful that typst-preview has a browser slide mode preview, and this can be saved from the browser to make a portable slide deck. However, this results in text that turns orange on hover, and is slightly inconvenient compared to an "export" option that would exist directly in the extension.

Other export modes (i.e. svg_html) are accessible through the typst-ts-cli executable, but slide mode is currently restricted to the preview extension which is why the feature request is here.

It is wonderful that typst-preview has a browser slide mode preview, and this can be saved from the browser to make a portable slide deck.

BTW this is a very interesting use case which I didn't think of before. Does it work well? How much is the binary size?

For a 19 page deck with many images:
PDF size: 5.9 MB
svg_html: 13.5 MB

Browser preview -> save: 1.8 MB

The document is totally portable since all resources end up being b64 encoded and directly embedded

I've made a foolish mistake during testing -- both computers were running vscode while the preview was being loaded, meaning the backend was responding to localhost requests... the saved file is in fact not portable in the current extension state. Rather, the first page shows no matter what, but everything else (i.e. stepping through the deck) is unresponsive

This is doable, since the only missing is that no render data are initialized. Imagine that we have snapshot and replay feature, then the page will work again. The only two events to snapshot are:

event 1: enable partial rendering 
event 2: reset document data (It is exactly the `typst-ts-cli compile --format vector`)