Ox Content

API Documentation

Generated by Ox Content

Modules

docs

  • function extractDocs - Extracts JSDoc documentation from source files in specified directories.

This fu...

  • function findFiles - Recursively finds all source files matching include/exclude patterns.

  • function extractFromContent - Extracts documentation entries from file content.

  • function extractFunctionSignature - Extracts the complete function signature for display.

Captures the full function...

  • function extractTypesFromSignature - Extracts parameter and return types from a TypeScript function signature.

Parses...

  • function splitParameters - Splits function parameters while respecting nested angle brackets (generics).

Ha...

  • function parseJsdocBlock - Parses a JSDoc block and the following declaration.

Only matches if the declarat...

  • function generateMarkdown - Generates Markdown documentation from extracted docs.

  • interface SymbolLocation - Symbol location info for cross-file linking.

  • function convertSymbolLinks - Converts symbol links [SymbolName] to markdown links.

Processes description text...

  • function buildSymbolMap - Builds a map of all symbols to their file locations.

  • function writeDocs - Writes generated documentation to the output directory.

  • function generateSourceLink - Generates a GitHub source link for a file and optional line number.

environment

  • function createMarkdownEnvironment - Creates the Markdown processing environment configuration.

This environment is u...

  • interface EnvironmentTransformContext - Environment-specific module transformer.

This is called during the transform pha...

  • function createTransformOptions - Creates environment-aware transform options.

  • function prerender - Runs pre-render for SSG.

This function is called during build to pre-render all ...

  • function createEnvironmentPlugins - Environment plugin factory.

Creates plugins specific to the Markdown environment...

highlight

  • function getHighlighter - Get or create the Shiki highlighter.

  • function rehypeShikiHighlight - Rehype plugin for syntax highlighting with Shiki.

  • function getTextContent - Extract text content from a hast node.

  • function highlightCode - Apply syntax highlighting to HTML using Shiki.

index

  • function oxContent - Creates the Ox Content Vite plugin.

  • function resolveOptions - Resolves plugin options with defaults.

  • function generateVirtualModule - Generates virtual module content.

jsx-runtime

  • function escapeHtml - Escapes HTML special characters to prevent XSS.

  • function toHtmlAttr - Converts a camelCase attribute name to kebab-case for HTML.

Special handling for...

  • function renderAttr - Renders an attribute value to a string.

  • type JSXElementType - JSX element type - either a string (intrinsic) or a function component.

  • type JSXChild - Valid JSX child types.

  • interface JSXNode - JSX node - the result of JSX expressions.

  • interface JSXProps - Props with children.

  • function renderChildren - Renders children to HTML string.

  • function jsx - Creates a JSX element.

This is the core function called by the JSX transform.

  • function jsxs - Creates a JSX element with static children.

Called by the JSX transform for elem...

  • function Fragment - Fragment component - renders children without a wrapper element.

  • function renderToString - Renders a JSX node to an HTML string.

  • function raw - Creates raw HTML without escaping.

Use with caution - only for trusted content.

  • function when - Conditionally renders content.

  • function each - Maps over an array and renders each item.

jsx.d

  • type Element - The type returned by JSX expressions.

  • interface IntrinsicElements - Props for intrinsic elements (HTML tags).

  • interface HTMLAttributes - Base HTML attributes shared by all elements.

  • type IntrinsicElementType - Type for intrinsic element constructors.

  • type IntrinsicElementProps - Props for a specific intrinsic element.

mermaid

  • function getTextContent - Extract text content from a hast node.

  • function rehypeMermaid - Rehype plugin to transform mermaid code blocks.

Replaces `mermaid blocks with ...

  • function transformMermaid - Transform mermaid code blocks in HTML.

Creates wrapper elements that can be rend...

nav-generator

  • function generateNavMetadata - Generates sidebar navigation metadata from extracted documentation.

Takes an arr...

  • function getDocDisplayName - Gets the human-readable display name for a documentation file.

Transforms file p...

  • function getDocFileName - Gets the file name (without extension) for use in navigation paths.

This handles...

  • function generateNavCode - Generates TypeScript code for navigation metadata export.

Creates a complete, se...

page-context

  • interface BasePageProps - Base page props available for all pages.

  • type PageProps - Extended page props with custom frontmatter.

  • interface SiteConfig - Site-wide configuration available in context.

  • interface NavGroup - Navigation group.

  • interface NavItem - Navigation item.

  • interface RenderContext - Complete render context.

  • function setRenderContext - Sets the current render context.

Called internally during page rendering.

  • function clearRenderContext - Clears the current render context.

Called internally after page rendering.

  • function usePageProps - Gets the current page props.

  • function useSiteConfig - Gets the site configuration.

  • function useRenderContext - Gets the full render context.

  • function useNav - Gets the navigation groups.

  • function useIsActive - Checks if the given path is the current page.

  • interface FrontmatterSchema - Schema for frontmatter type generation.

  • function inferType - Infers TypeScript types from frontmatter values.

  • function generateFrontmatterTypes - Generates TypeScript interface from frontmatter samples.

search

  • function resolveSearchOptions - Resolves search options with defaults.

  • function collectMarkdownFiles - Collects all Markdown files from a directory.

  • function buildSearchIndex - Builds the search index from Markdown files.

  • function writeSearchIndex - Writes the search index to a file.

  • function generateSearchModule - Client-side search module code.

This is injected into the bundle as a virtual mo...

ssg

  • interface SsgNavItem - Navigation item for SSG.

  • interface SsgEntryPageConfig - Entry page configuration for SSG (passed to Rust).

  • interface SsgPageData - Page data for SSG.

  • function resolveSsgOptions - Resolves SSG options with defaults.

  • function renderTemplate - Simple mustache-like template rendering.

  • function extractTitle - Extracts title from content or frontmatter.

  • function _generateNavHtml - Generates navigation HTML from nav groups.

  • function _generateTocHtml - Generates TOC HTML from toc entries.

  • function generateBareHtmlPage - Generates bare HTML page (no navigation, no styles).

  • function generateHtmlPage - Generates HTML page with navigation using Rust NAPI bindings.

  • function getOutputPath - Converts a markdown file path to its corresponding HTML output path.

  • function getUrlPath - Converts a markdown file path to a relative URL path.

  • function getHref - Converts a markdown file path to an href.

  • function getOgImagePath - Gets the OG image output path for a given markdown file.

  • function getOgImageUrl - Gets the OG image URL for use in meta tags.

If siteUrl is provided, returns an a...

  • function getDisplayTitle - Gets display title from file path.

  • function formatTitle - Formats a file/dir name as a title.

  • function collectMarkdownFiles - Collects all markdown files from the source directory.

  • interface NavGroup - Navigation group for hierarchical navigation.

  • function buildNavItems - Builds navigation items from markdown files, grouped by directory.

  • function buildSsg - Builds all markdown files to static HTML.

theme-renderer

  • type ThemeComponent - Theme component type.

  • interface ThemeProps - Props passed to the theme component.

  • interface PageData - Page data for rendering.

  • interface ThemeRenderOptions - Theme render options.

  • function renderPage - Renders a page using the theme component.

  • function renderAllPages - Renders all pages and generates type definitions.

  • function generateTypes - Generates TypeScript type definitions from page frontmatter.

  • function DefaultTheme - Default theme component.

A minimal theme that renders page content with basic st...

  • function createTheme - Creates a theme with layout switching support.

theme

  • interface ThemeColors - Theme color configuration.

  • interface ThemeLayout - Theme layout configuration.

  • interface ThemeFonts - Theme font configuration.

  • interface ThemeHeader - Theme header configuration.

  • interface ThemeFooter - Theme footer configuration.

  • interface SocialLinks - Social links configuration.

  • interface ThemeSlots - Theme slots for injecting custom HTML.

  • interface ThemeConfig - Complete theme configuration.

  • interface ResolvedThemeConfig - Resolved theme configuration (after merging with defaults).

  • function deepMerge - Deep merge two objects.

  • function defineTheme - Defines a theme configuration with type checking.

  • function mergeThemes - Merges multiple theme configurations.

Later themes override earlier ones.

  • function resolveTheme - Resolves a theme configuration by merging with its extends chain and defaults.

  • function themeToNapi - Converts resolved theme to the format expected by Rust NAPI.

  • interface NapiThemeColors - NAPI-compatible theme colors type.

  • interface NapiThemeFonts - NAPI-compatible theme fonts type.

  • interface NapiThemeLayout - NAPI-compatible theme layout type.

  • interface NapiThemeHeader - NAPI-compatible theme header type.

  • interface NapiThemeFooter - NAPI-compatible theme footer type.

  • interface NapiSocialLinks - NAPI-compatible social links type.

  • interface NapiThemeSlots - NAPI-compatible theme slots type.

  • interface NapiThemeConfig - NAPI-compatible theme configuration type.

transform

  • interface NapiBindings - NAPI bindings for Rust-based Markdown processing.

Provides access to compiled Ru...

  • interface OgImageData - OG image data for generating social media preview images.

  • interface OgImageConfig - OG image configuration.

  • interface JsTransformOptions - Options for Rust-based Markdown transformation.

Controls which Markdown extensio...

  • function loadNapiBindings - Lazily loads and caches NAPI bindings.

This function uses lazy loading to defer ...

  • interface SsgTransformOptions - SSG-specific transform options.

  • function parseFrontmatter - Parses YAML frontmatter from Markdown content.

Uses proper YAML parser for full ...

  • function buildTocTree - Builds nested TOC tree from flat list.

  • function generateModuleCode - Generates the JavaScript module code.

  • function extractImports - Extracts imports from Markdown content.

Supports importing components for intera...

  • function generateOgImageSvg - Generates an OG image SVG using the Rust-based generator.

This function uses the...

types

  • interface HeroAction - Hero section action button.

  • interface HeroImage - Hero section image configuration.

  • interface HeroConfig - Hero section configuration for entry page.

  • interface FeatureConfig - Feature card for entry page.

  • interface EntryPageConfig - Entry page frontmatter configuration.

  • interface SsgOptions - SSG (Static Site Generation) options.

  • interface ResolvedSsgOptions - Resolved SSG options.

  • interface OxContentOptions - Plugin options.

  • interface ResolvedOptions - Resolved options with all defaults applied.

  • interface OgImageOptions - OG image generation options.

  • interface MarkdownTransformer - Custom AST transformer.

  • interface TransformContext - Transform context passed to transformers.

  • interface MarkdownNode - Markdown AST node (simplified for TypeScript).

  • interface TransformResult - Transform result.

  • interface TocEntry - Table of contents entry.

  • interface DocsOptions - Options for source documentation generation.

  • interface ResolvedDocsOptions - Resolved docs options with all defaults applied.

  • interface DocEntry - A single documentation entry extracted from source.

  • interface ParamDoc - Parameter documentation.

  • interface ReturnDoc - Return type documentation.

  • interface ExtractedDocs - Extracted documentation for a single file.

  • interface NavItem - Navigation item for sidebar navigation.

  • interface SearchOptions - Options for full-text search.

  • interface ResolvedSearchOptions - Resolved search options.

  • interface SearchDocument - Search document structure.

  • interface SearchResult - Search result structure.