Previewing content

Per default, the preview is on the right side of a vertical split screen and shows the rendered contents of the editor.

Overview

By default, the preview is on the right side of a vertical split screen. Using the configuration, the user can change the split to horizontal, and change the position of the preview.

The plugin uses AsciidoctorJ 2.x to render the preview.

By default, the plugin runs Asciidoctor in UNSAFE mode, which is also the default when a user runs Asciidoctor from the command line. In the plugin’s settings, the user can change the behavior to other modes, such as SAFE, SERVER, and SECURE. See section Running Asciidoctor securely in the Asciidoctor User Manual for more information about this feature.

Remote content is no longer allowed in the JavaFX preview when using the JCEF and the safe mode settings SAFE, SERVER, or SECURE. With this setting the plugin applies a Content Security Policy to prevent this (new in plugin version 0.32.32).

When the user enters formulas using Asciidoctor’s math support, the preview renders them using MathML. If MathML can’t parse the formula, the preview shows an error popup.

When the user moves the cursor in the editor, the preview scrolls the text into the preview.

When the user clicks on the text in the preview, the editor moves the cursor to the clicked text. This is accurate at the block level, but unfortunately, it is not yet accurate at the line or character levels. If the preview content is part of an included file, the editor opens the included file (new in plugin version 0.32.5). When the user clicks on a collapsible block, this click will not place the cursor or open a file.

The JCEF, browser preview, and HTML conversion support the Asciidoctor Tabs extension (new in plugin version 0.40.3). For the preview, it sets ths attribute tabs-sync-option so any re-rendering keeps the focus on the currently selected tab. Selecting a tab with a mouse click will not place the cursor in the editor and will not open an included file. To place the cursor or open the included file, click on the body of the tab. The Asciidoctor Tabs extension is not supported for the JavaFX preview and is not supported for PDF generation.

When the user clicks on an external URL, the preview opens it in an external browser.

When the user clicks on a relative link within the project (usually a link:[] reference), the preview opens the referenced file in a new editor.

When the user right-clicks on an image, the editor shows a dialog to save the file to the local file system. For diagrams like PlantUML, it offers to save the files as PNG or SVG. Windows and Linux users have a dropdown menu for this. MacOS users need to type the extension for the target file name (.svg or .png)

The user can zoom in and out of the preview by holding Ctrl and scrolling the mouse wheel up or down. Clicking the middle mouse button while holding Ctrl resets the zoom to 100%.

Advanced

The preview can use custom stylesheets. See Custom stylesheets for the preview for details.