• Stars
    star
    450
  • Rank 97,143 (Top 2 %)
  • Language Typst
  • License
    MIT License
  • Created over 1 year ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[DEPRECATED] Use tinymist instead

Typst Preview VSCode

Preview your Typst files in vscode instantly!

Install this extension from marketplace, open command palette (Ctrl+Shift+P), and type >Typst Preview:.

2023-06-30.15-31-19.mp4

This repo contains:

  • the native part of the extension, in rust
  • a vscode extension, in typescript

Features

  • Low latency preview: preview your document instantly on type. The incremental rendering technique makes the preview latency as low as possible.
  • Open in browser: open the preview in browser, so you put it in another monitor. typst/typst#1344
  • Cross jump between code and preview: We implement SyncTeX-like feature for typst-preview. You can now click on the preview panel to jump to the corresponding code location, and vice versa.

For comparison between alternative tools, please refer to Comparison with other tools.

Bug report

To achieve high performance instant preview, we use a different rendering backend from official typst. We are making our best effort to keep the rendering result consistent with official typst. We have set up comprehensive tests to ensure the consistency of the rendering result. But we cannot guarantee that the rendering result is the same in all cases. There can be unknown corner cases that we haven't covered.

Therefore, if you encounter any rendering issue, please report it to this repo other than official typst repo.

How it works?

The extension watches for file changes, and incrementally compile your document to svg files. Then we use a websocket to send the rendered svg to the client. The client calculates the diff between the new svg and the old one, and apply the diff to the old one. This is done by a VDOM based incremental rendering technique.

If you are interested in the details, please refer to Typst-Preview Architecture.

Use without VSCode

You can use the binary typst-preview as a standalone typst preview server. It can be used to preview your document in browser. For example: typst-preview ./assets/demo/main.typ --partial-rendering. This should be useful if you don't use VSCode but still want to experience the low latency preview.

Acknowledgements

  • typst.ts: typst.ts provide incremental svg export.
  • typst-lsp: The CI and the vscode extension are heavily inspired by typst-lsp.

Legal

This project is not affiliated with, created by, or endorsed by Typst the brand.

More Repositories

1

cxx2flow

将 C/C++ 代码转换成流程图 / Turn your C/C++ code into flowchart
Rust
479
star
2

typstyle

Beautiful and reliable typst code formatter
Typst
259
star
3

rspb

pastebin written in pure rust. A rewrite of ptpb/pb.
Rust
42
star
4

luoguPaintAutomatonTS

luogu冬日画板自动绘图脚本支持多用户,维护
TypeScript
34
star
5

typst-ws

preview your typst document in instant
Rust
27
star
6

cxx2flow-gui

Tauri based GUI for cxx2flow
Vue
26
star
7

tetris

在自制 RISC-V CPU 和 x86 上运行的现代俄罗斯方块 / Modern tetris that runs on self-made RISC-V CPU and x86 machines.
C
16
star
8

simplerv

Verilog
14
star
9

cpprepl

a deadly simple repl for cpp with ghci style commands
C++
13
star
10

LuoguPaintAutomaton

luogu冬日画板自动绘图脚本
Python
10
star
11

hubakc

Authorize an ssh session using your keys on GitHub.
Rust
6
star
12

libinteger

big num support at binary level
C++
5
star
13

richat

Realtime chat with markdown/LaTeX support
JavaScript
5
star
14

MathEditor

LaTeX equation editor, based on zhihu
Vue
4
star
15

MaterialSlide

A material design slide. Easy to use
HTML
4
star
16

fasterminal

a deadly simple utility to toggle windows terminal using hotkeys
C++
4
star
17

bottom-wallpaper

动态桌面壁纸:系统资源监视
C++
3
star
18

usysy

An incomplete SysY compiler in Rust and LLVM
C
3
star
19

hackweek

Go
3
star
20

lookup

simple cli dictionary
TypeScript
2
star
21

richat-backend

Realtime chat with markdown/LaTeX support - backend
JavaScript
2
star
22

unique_lab_shell

a linux shell written in cxx
C++
1
star
23

nas-fanctl

Rust
1
star
24

remark-code-wrap

JavaScript
1
star
25

content_recommend

Python
1
star
26

zint-wasi

C
1
star
27

mainpage

HTML
1
star
28

serial2tcp

serve serial over tcp, or connect serial port to a tcp server
Rust
1
star