@starside-io/verso-runtime
v0.3.1
Published
Verso rendering engine and public extension API
Readme
@starside-io/verso-runtime
Verso rendering engine and public extension API. Use this package to register custom layouts and components.
What's in here
renderDeck(manifest, slides, registry, pathId)— SSR-able HTML string for a full deckmount(target, options)— browser-side mount with keyboard nav, speaker mode, and transitionsLayoutRegistry / ComponentRegistry / ThemeRegistry— registries for custom extensions- Types:
LayoutContext,RenderContext,LayoutDef,ComponentDef
Install
npm install @starside-io/verso-runtimeCustom layout example
import { LayoutRegistry } from '@starside-io/verso-runtime'
import { html } from '@starside-io/verso-runtime'
LayoutRegistry.register({
name: 'my-layout',
render(ctx) {
return html`<div class="my-layout">${ctx.renderBlocks(ctx.content)}</div>`
},
})Register custom layouts in verso.config.ts at the project root and scaffold one with verso new layout <name>.
Docs
github.com/starside-io/verso/blob/main/docs/custom-layouts.md
Part of the Verso monorepo. Apache 2.0.
