4.2 HTML Preview

You can generate the HTML preview of a Texinfo document in Visual Studio Code, to see how the document looks like when displayed in a web browser.

In the active text editor which contains a Texinfo document, click the “Show Preview” button on the top right of the editor. A webview will be created in a split editor (if not already), and the HTML preview will be displayed there. The “Show Preview” command is also available in command palette, and has a default Ctrl+K V key binding (on GNU/Linux).

The HTML used for preview is generated by makeinfo --html --nosplit, and Texinfo source is read from disk, instead of taken from a vscode.TextDocument. The editor may prompt you to save to file when trying to display preview of a document which does not yet exist on disk, so that the preview can be displayed.

An opened preview automatically tracks the behaviour of the corresponding document. When the document is saved, the preview will refresh. When the editor holding the document is closed, the preview also closes.

Texinfo documents tend to be rather large, and makeinfo may take some time to finish. When you see an “(Updating)” in the title of a preview, it means that the preview is being updated.