reader-chrome.ts#
8 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference#
fnapplyReaderChromeHtml(html: string, input: ReaderChromeInput = true): stringApply the same native reader-chrome HTML transform used by the built-in SSG. Th…
Apply the same native reader-chrome HTML transform used by the built-in SSG.
This rewrites rendered article HTML. It wraps fenced <pre> blocks for copy controls and decorates outbound links when enabled. Back-to-top remains a document-shell control, so it is exposed through the asset helpers.
Signature
export function applyReaderChromeHtml(html: string, input: ReaderChromeInput = true): stringParameters
-
htmlstring -
inputReaderChromeInputoptional · default: true
Returns
string
fnreaderChromeAttributes(input: ReaderChromeInput = true): Readonly<Record<string, "">>Root attributes consumed by the browser runtime.
Root attributes consumed by the browser runtime.
Signature
export function readerChromeAttributes(input: ReaderChromeInput = true): Readonly<Record<string, "">>Parameters
-
inputReaderChromeInputoptional · default: true
Returns
Readonly<Record<string, "">>
fnreaderChromeCss(input: ReaderChromeInput = true): stringCSS shared by the built-in SSG and custom hosts.
CSS shared by the built-in SSG and custom hosts.
Signature
export function readerChromeCss(input: ReaderChromeInput = true): stringParameters
-
inputReaderChromeInputoptional · default: true
Returns
string
fnreaderChromeScript(input: ReaderChromeInput = true): stringAuto-initializing script shared by the built-in SSG and custom hosts.
Auto-initializing script shared by the built-in SSG and custom hosts.
Signature
export function readerChromeScript(input: ReaderChromeInput = true): stringParameters
-
inputReaderChromeInputoptional · default: true
Returns
string
fnrenderReaderChromeAttributes(input: ReaderChromeInput = true): stringRender the root attributes as a leading-space HTML fragment. Useful in template…
Render the root attributes as a leading-space HTML fragment.
Useful in template strings: <article${renderReaderChromeAttributes()}>.
Signature
export function renderReaderChromeAttributes(input: ReaderChromeInput = true): stringParameters
-
inputReaderChromeInputoptional · default: true
Returns
string
fnrenderReaderChromeScriptTag(input: ReaderChromeInput = true): stringInline auto-init script for static hosts that do not bundle @ox-content/vite-pl…
Inline auto-init script for static hosts that do not bundle @ox-content/vite-plugin/reader-chrome/client.
Signature
export function renderReaderChromeScriptTag(input: ReaderChromeInput = true): stringParameters
-
inputReaderChromeInputoptional · default: true
Returns
string
fnrenderReaderChromeStyleTag(input: ReaderChromeInput = true): stringInline stylesheet tag for hosts that do not import @ox-content/vite-plugin/styl…
Inline stylesheet tag for hosts that do not import @ox-content/vite-plugin/styles/reader-chrome.css.
Signature
export function renderReaderChromeStyleTag(input: ReaderChromeInput = true): stringParameters
-
inputReaderChromeInputoptional · default: true
Returns
string
fnresolveReaderChromeInput(input: ReaderChromeInput = true): ResolvedReaderChromeResolve the public reader-chrome option shape. true mirrors ssg.readerChrome: t…
Resolve the public reader-chrome option shape.
true mirrors ssg.readerChrome: true: copy, outbound-link decoration, and back-to-top are enabled. Object fields default on, so { copy: false } disables only the copy button.
Signature
export function resolveReaderChromeInput(input: ReaderChromeInput = true): ResolvedReaderChromeParameters
-
inputReaderChromeInputoptional · default: true