Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support to preview typst targeting html #1238

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Myriad-Dreamin
Copy link
Owner

Adding support to previewing typst document in HTML target, i.e. typst compile main.typ main.html. Only PoC works, but the arch is already set up.

image

Although different targets share a same main source file, when targeting html, typst interpreter runs on completely different control flow from the one targeting paged. For example, the following document has content html.div(y) when targeting html, and has content box(width: 10em, x) when targeting paged:

#context if page.target == paged {
  box(width: 10em, x)
} else {
  html.div(y)
}

A main question is throwed at once: how do we inform the language server to run code targeting html? Or whether we should run both targets to get diagnostics on both targets as many as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant