WebServerPreviewStrategy

class WebServerPreviewStrategy(port: Int, browser: BrowserLauncher?, preferLivePreviewUrl: Boolean) : PreviewStrategy

PreviewStrategy backed by the bundled Quarkdown web server (the same one exposed by quarkdown start).

On the first call to update the server is started lazily and pointed at the just-generated output directory; subsequent calls reuse the running server and only push a reload trigger over a stateless HTTP call, which the server fans out as Server-Sent Events to every subscribed browser tab.

Parameters

port

port on which the preview server is started and contacted for reload triggers

browser

optional browser launcher used to open the served URL the first time the server starts

preferLivePreviewUrl

whether to open the live-preview endpoint URL rather than the direct file URL, typically enabled when both preview and watch modes are active

Constructors

Link copied to clipboard
constructor(port: Int, browser: BrowserLauncher?, preferLivePreviewUrl: Boolean)

Functions

Link copied to clipboard
open override fun update(options: PipelineOptions, outcome: ExecutionOutcome)

Notifies the preview target that a new compilation outcome is available and that the preview should be refreshed accordingly. Implementations are expected to be invoked once per successful compile and may keep internal state.