Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
795 stars 36 forks source link

Feature request: Enable svg elements with video embeds #610

Open ntjess opened 1 month ago

ntjess commented 1 month ago

Port of https://github.com/Enter-tainer/typst-preview/issues/242

It would be great if tinymist exposed both CLI and vscode settings for allowing video embeds

Myriad-Dreamin commented 1 month ago

The multimedia support is already gotten in shiroa. We may just consider whether it is stable enough for exposing in tinymist. The main idea is leaving an image hole in the document to be filled with external tools like typst.ts. The external tools will perform extremely strict sanity checking to avoid arbitrary HTML injection. For example, shiroa can only allow embedding video with short YouTube url or reading videos in workspace.

Rust-side:

https://github.com/Myriad-Dreamin/shiroa/blob/1d570da2c578091c7e338d9bdb3721cde65f7567/cli/src/render/typst.rs#L714-L751

Typst-side:

https://github.com/Myriad-Dreamin/shiroa/blob/1d570da2c578091c7e338d9bdb3721cde65f7567/packages/shiroa/xcommand.typ

Demo:

https://myriad-dreamin.github.io/shiroa/format/supports/multimedia.html