diff --git a/doc/vscode-texinfo.texi b/doc/vscode-texinfo.texi index fbd5bf7..440748e 100644 --- a/doc/vscode-texinfo.texi +++ b/doc/vscode-texinfo.texi @@ -7,6 +7,7 @@ @c %**end of header @set vscode-docs-url https://code.visualstudio.com/docs +@set vscode-api-url https://code.visualstudio.com/api @copying This manual is for vscode-texinfo (version @value{VERSION}), an extension of @@ -340,6 +341,56 @@ extension. To manually trigger a refresh, click the status bar item. @node HTML Preview @section 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 online. + +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 +@code{Ctrl+K V} key binding (on GNU/Linux). + +The HTML used for preview is generated by @code{makeinfo --html --nosplit}, and +Texinfo source is read from disk, instead of taken from a +@url{@value{vscode-api-url}/references/vscode-api#TextDocument, +@code{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 @code{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. + +@menu +* Custom CSS:: Use custom stylesheets for HTML preview. +* Goto Node:: Jump to a node in preview. +* Misc Settings:: Miscellaneous configuration options regarding preview. +@end menu + + +@node Custom CSS +@subsection Custom CSS + +You can use a custom CSS to make the HTML preview look prettier. To configure +this, edit the configuration option @code{texinfo.preview.customCSS}. The CSS +file can either be an online or a local (starting with @code{file://}) resource. + +A good example is @url{https://www.gnu.org/software/gnulib/manual.css}, which is +popular among manuals of GNU projects. (Note: May require some tinkering when +used with darker editor themes) + + +@node Goto Node +@subsection Goto Node + + +@node Misc Settings +@subsection Misc Settings + @node Diagnosis @section Diagnosis