Extension API: General HTML preview for LaTeX, Typst, AsciiDoc... #27163
Replies: 6 comments
|
|
so zed may need a custom rendering model which is decoupled from markdown. likely related gpui apis. |
|
This is the exact category of API gap I am hitting. Concrete use case: agents now commonly generate standalone local The useful MVP does not need to be a full browser:
If this becomes an extension API, the missing primitive seems to be: an extension can register preview providers by file pattern, receive the file path/buffer content, and return either a safe native preview model or a constrained HTML preview surface. If arbitrary webview support is too large, even a first-party This would cover real-time HTML preview, but the motivating workflow is even simpler: open a standalone generated |
I have to say rendering an HTML file is a complex thing no matter if it's generated automatically or written directly by an agent. If an HTML is rendered dynamically do you have to add a JavaScript engine to calculate the logic? or when there is an iframe you have to render the related webpage recursively? It can increase the size of the app so it may prefer to open the HTML file externally |
AsciiDoc / SoT tooling use case (browser workaround today)Same API gap from the AsciiDoc side: we want a Zed extension with source-of-truth conversion (Asciidoctor / native engine), LSP diagnostics, and accurate highlighting via semantic tokens. In-editor HTML preview is the missing piece. Today the workable path is:
That works, but it is a poor substitute for open-to-the-side preview with scroll sync. A useful MVP that would unblock AsciiDoc (and Typst/LaTeX/agent HTML artifacts) without a full embedded browser:
Related: |
|
I second this request. Another use case for this: Carve, a lightweight markup language (post-Markdown). The language extension (markup-carve/zed-carve) covers highlighting, injections and outline via tree-sitter, but there is currently no way to offer a rendered preview next to the editor, which is the one feature markup users ask for first. A read-only preview API as proposed here would be enough for this case:
No webview needed for that. Markdown's built-in preview already proves the native renderer approach works; exposing a subset of that block model to extensions would cover Carve, AsciiDoc, Typst, reStructuredText and friends without pulling in a browser engine. Happy to be an early adopter / test this against a real grammar once an experimental API exists. |
Uh oh!
There was an error while loading. Please reload this page.
Markdown previewing is builtin with Zed while we cannot preview even real-time HTML files. I have two questions here:
All reactions