Skip to content

reader-chrome.ts#

View Markdown

Source

8 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

8 symbols 8 functions 9 parameters 8 returns

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): string

View source

Parameters

  • html string
  • input ReaderChromeInput

    optional · 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, "">>

View source

Parameters

  • input ReaderChromeInput

    optional · 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): string

View source

Parameters

  • input ReaderChromeInput

    optional · 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): string

View source

Parameters

  • input ReaderChromeInput

    optional · 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): string

View source

Parameters

  • input ReaderChromeInput

    optional · 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): string

View source

Parameters

  • input ReaderChromeInput

    optional · 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): string

View source

Parameters

  • input ReaderChromeInput

    optional · 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): ResolvedReaderChrome

View source

Parameters

  • input ReaderChromeInput

    optional · default: true

Returns

ResolvedReaderChrome