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.

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...

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 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.

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 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 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.