index.ts
5 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference
moduleindexox-content Built-in Plugins All plugins are designed with No-JavaScript-First principle. They generate static HTML at b…
ox-content Built-in Plugins
All plugins are designed with No-JavaScript-First principle. They generate static HTML at build time and require no client-side JS.
fnnormalizeSelfClosingEmbeds(html: string): stringCustom embed tags are not HTML void elements, so a self-closing authoring form…
Custom embed tags are not HTML void elements, so a self-closing authoring form like <GitHub ... /> reaches the HTML re-parsers (Shiki highlighting, embed transforms) as an unclosed element that swallows the rest of the document. Normalize to an explicit open/close pair before any rehype pass runs.
Signature
export function normalizeSelfClosingEmbeds(html: string): string
Parameters
-
htmlstring
Returns
string
interfaceTransformAllOptionsTransform all plugin components in HTML. Call this during SSG build to process…
Transform all plugin components in HTML. Call this during SSG build to process all plugins at once.
Signature
export interface TransformAllOptions
Members
Properties
| Name | Type | Description |
|---|---|---|
blueskyoptional |
boolean |
|
githuboptional |
boolean | GitHubOptions |
|
githubTokenoptional |
string |
|
mermaidoptional |
boolean |
|
ogpoptional |
boolean | OgpOptions |
|
openGraphoptional |
boolean | OgpOptions |
|
pmoptional |
boolean | PmOptions |
Expand <pm> package-manager blocks into install tabs. Pass an object toopt in to synced groups ( { sync: true }); syncing is off by default.Default false |
spotifyoptional |
boolean |
|
stackBlitzoptional |
boolean |
|
tabsoptional |
boolean |
|
twitteroptional |
boolean | TwitterEmbedOptions |
|
webContaineroptional |
boolean |
|
youtubeoptional |
boolean |
fntransformAllPlugins(html: string, options: TransformAllOptions = {}): Promise<string>Transform all enabled plugins in HTML content.
Transform all enabled plugins in HTML content.
Signature
export async function transformAllPlugins(html: string, options: TransformAllOptions = {}): Promise<string>
Parameters
-
htmlstring -
optionsTransformAllOptionsoptional · default: {}
Returns
Promise<string>
fntransformBuiltinEmbeds(html: string, options: { github: GitHubOptions | false; openGraph: OgpOptions | false; pm?: PmOptions | false; spotify?: boolean; stackBlitz?: boolean; twitter?: boolean | TwitterEmbedOptions; bluesky?: boolean; webContainer?: boolean; }): Promise<string>Transform built-in embed components in HTML content.
Transform built-in embed components in HTML content.
Signature
export async function transformBuiltinEmbeds(html: string, options: {
github: GitHubOptions | false;
openGraph: OgpOptions | false;
pm?: PmOptions | false;
spotify?: boolean;
stackBlitz?: boolean;
twitter?: boolean | TwitterEmbedOptions;
bluesky?: boolean;
webContainer?: boolean;
}): Promise<string>
Parameters
-
htmlstring -
options.githubGitHubOptions | false -
options.openGraphOgpOptions | false -
options.pm?PmOptions | falseoptional
-
options.spotify?booleanoptional
-
options.stackBlitz?booleanoptional
-
options.twitter?boolean | TwitterEmbedOptionsoptional
-
options.bluesky?booleanoptional
-
options.webContainer?booleanoptional
Returns
Promise<string>