-- lx-bundle:true

--- Render basic LiqubePage documents through the shared preview engine
-- @module plugins.lppreview

local open_handler = require("core.open_handler")

--- Create one basic LiqubePage preview
-- @param request table shared open request
-- @return table view rendered LiqubePage view
local function create_preview(request)
	local LiqubePagePreview = require("plugins.lppreview.view")

	return LiqubePagePreview(request.doc, request.options)
end

-- The LiqubePage format chooses preview mode for page documents
open_handler.register({
	name = "lppreview",
	formats = { "liqubepage" },
	modes = { "preview" },
	create_view = create_preview,
})
