Saltar al contenido principal
17 min de lectura
Editar en GitHub

Referencia de API (Deno Doc)

Referencia técnica generada automáticamente a partir del código fuente mediante deno doc

Referencia de API (Deno Doc) #

Esta página de referencia se compila automáticamente analizando las firmas de tipos y comentarios JSDoc con deno doc.


Índice de Símbolos #


BuildOptions #

Tipo: interface | Ubicación: builder.ts:9

Options configuring the Zerho static site generator compilation process.

Propiedades #

PropiedadTipoOpcionalDescripción
`devMode``boolean`SíRun builder in development mode enabling livereload and development banners
`outDir``string`SíOutput directory path for compiled static assets (defaults to 'dist')
`docsDir``string`SíSource documentation directory containing Markdown files (defaults to 'docs')
`skipDocgen``boolean`SíSkip automatic generation of API reference documentation via deno doc
`config``ZerhoConfig`SíOptional explicit ZerhoConfig override

LlmsPageEntry #

Tipo: interface | Ubicación: builder.ts:23

Represents an indexed page entry prepared for LLM and agent ingestion.

Propiedades #

PropiedadTipoOpcionalDescripción
`title``string`NoTitle of the document
`description``string`NoSummary description extracted from frontmatter or generated
`route``string`NoCanonical route URL path
`rawContent``string`NoClean Markdown content ready for LLM consumption

generateSitemapXml #

Tipo: function | Ubicación: builder.ts:40

Generates standards-compliant sitemap.xml for search engines and SEO crawlers.

TYPESCRIPT
function generateSitemapXml(routes: string[], baseUrl = "https://zerho.xyz"): string;

Retorna: string — Formatted XML sitemap string

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`routes``string[]`No—List of canonical URL paths to include in the sitemap
`baseUrl``string`Sí`"https://zerho.xyz"`Canonical production domain origin

generateRobotsTxt #

Tipo: function | Ubicación: builder.ts:59

Generates robots.txt pointing to the production sitemap.

TYPESCRIPT
function generateRobotsTxt(baseUrl = "https://zerho.xyz"): string;

Retorna: string — Formatted robots.txt string

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`baseUrl``string`Sí`"https://zerho.xyz"`Canonical production domain origin

generateLlmsTxt #

Tipo: function | Ubicación: builder.ts:71

Generates /llms.txt according to the llmstxt.org specification for LLM agents.

TYPESCRIPT
function generateLlmsTxt(pages: LlmsPageEntry[], baseUrl = "https://zerho.xyz", siteTitle = "Zerho", siteDescription = "El motor de documentación de nivel pro diseñado nativamente para Deno & Deno Deploy"): string;

Retorna: string — Formatted Markdown llms.txt string

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`pages``LlmsPageEntry[]`No—Indexed documentation pages
`baseUrl``string`Sí`"https://zerho.xyz"`Canonical production domain origin
`siteTitle``string`Sí`"Zerho"`Site brand title
`siteDescription``string`Sí`"El motor de documentación de nivel pro diseñado nativamente para Deno & Deno Deploy"`Concise tagline or description

generateLlmsFullTxt #

Tipo: function | Ubicación: builder.ts:111

Generates /llms-full.txt containing the entire concatenated documentation for direct LLM ingestion.

TYPESCRIPT
function generateLlmsFullTxt(pages: LlmsPageEntry[], baseUrl = "https://zerho.xyz", siteTitle = "Zerho"): string;

Retorna: string — Consolidated Markdown documentation string

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`pages``LlmsPageEntry[]`No—Indexed documentation pages
`baseUrl``string`Sí`"https://zerho.xyz"`Canonical production domain origin
`siteTitle``string`Sí`"Zerho"`Site brand title

generateRssFeedXml #

Tipo: function | Ubicación: builder.ts:142

Generates an RSS 2.0 XML feed (/feed.xml) for documentation updates and release syndication.

TYPESCRIPT
function generateRssFeedXml(pages: LlmsPageEntry[], baseUrl = "https://zerho.xyz", siteTitle = "Zerho", siteDescription = "Documentación técnica impulsada por Zerho"): string;

Retorna: string — Standards-compliant RSS 2.0 XML string

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`pages``LlmsPageEntry[]`No—Indexed documentation pages
`baseUrl``string`Sí`"https://zerho.xyz"`Canonical production domain origin
`siteTitle``string`Sí`"Zerho"`Site brand title
`siteDescription``string`Sí`"Documentación técnica impulsada por Zerho"`Concise tagline or description

generateOgImageSvg #

Tipo: function | Ubicación: builder.ts:191

Generates a dynamic OpenGraph SVG preview card (1200x630) for social sharing on X, Discord, and Slack.

TYPESCRIPT
function generateOgImageSvg(title: string, description: string, siteTitle = "Zerho", primaryColor = "#7c3aed"): string;

Retorna: string — Complete 1200x630 SVG document string

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`title``string`No—Page title
`description``string`No—Page summary description
`siteTitle``string`Sí`"Zerho"`Brand or project title
`primaryColor``string`Sí`"#7c3aed"`Primary brand hex color

resolveConfigForPath #

Tipo: function | Ubicación: builder.ts:236

Resolves effective configuration applying locale overrides if currentPath belongs to a registered locale.

TYPESCRIPT
function resolveConfigForPath(baseConfig: ZerhoConfig, path: string): ZerhoConfig;

Retorna: ZerhoConfig — Localized configuration object

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`baseConfig``ZerhoConfig`No—Global root Zerho configuration
`path``string`No—Current route path being rendered

DeadLinkIssue #

Tipo: interface | Ubicación: builder.ts:262

Represents a broken internal link or missing anchor fragment detected during site compilation.

Propiedades #

PropiedadTipoOpcionalDescripción
`sourceRoute``string`NoRoute of the page containing the broken link
`targetHref``string`NoTarget href attribute that failed validation
`reason``string`NoHuman-readable explanation of why the link is invalid

loadUserConfig #

Tipo: function | Ubicación: builder.ts:277

Dynamically loads a project's local zerho.config.ts from the given workspace root, falling back to the default engine configuration if not present.

TYPESCRIPT
function loadUserConfig(workspaceDir = {}): Promise<ZerhoConfig>;

Retorna: Promise<ZerhoConfig> — Resolved ZerhoConfig object

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`workspaceDir``string`Sí`{}`Project root directory (defaults to Deno.cwd())

generateAutoSidebar #

Tipo: function | Ubicación: builder.ts:305

Generates an automatic sidebar hierarchy from discovered documentation pages, grouped by top-level directory and sorted by frontmatter order then title.

TYPESCRIPT
function generateAutoSidebar(pages: Array<any>): SidebarItem[];

Retorna: SidebarItem[] — Generated array of SidebarItem groups

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`pages``Array`No—Discovered compiled pages with routes and parsed metadata

Tipo: function | Ubicación: builder.ts:351

Validates internal links and heading anchors across all compiled documentation pages.

TYPESCRIPT
function validateInternalLinks(pages: Array<any>, knownRoutes: Set<string>): DeadLinkIssue[];

Retorna: DeadLinkIssue[] — List of broken internal links or missing anchor targets

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`pages``Array`No—Compiled pages with route, rendered HTML, and table-of-contents anchor IDs
`knownRoutes``Set`No—Set of valid canonical routes in the site

buildSite #

Tipo: function | Ubicación: builder.ts:433

Compiles Markdown documentation into static HTML, CSS, search index, and LLM endpoints.

TYPESCRIPT
function buildSite(options = {}): Promise<void>;

Retorna: Promise<void> — Promise resolving when site compilation is complete

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`options``BuildOptions`Sí`{}`Build configuration options

TocItem #

Tipo: interface | Ubicación: markdown.ts:25

Represents an entry in the document's Table of Contents (TOC) hierarchy.

Propiedades #

PropiedadTipoOpcionalDescripción
`id``string`NoUnique anchor fragment identifier
`text``string`NoVisible heading title text
`level``number`NoHeading depth level (e.g. 2 for h2, 3 for h3)

Frontmatter #

Tipo: interface | Ubicación: markdown.ts:35

Schema for document YAML frontmatter metadata and layout settings.

Propiedades #

PropiedadTipoOpcionalDescripción
`title``string`SíDocument page title
`description``string`SíMeta description for search engines and SEO
`order``number`SíNumeric ordering index used when generating automatic sidebars
`layout``doc | home | page`SíLayout mode: 'doc' for documentation with sidebar, 'home' for hero landing, 'page' for generic
`hero``any`SíHero banner configuration for landing pages
`features``Array`SíFeature cards displayed on landing pages
`editLink``boolean`SíWhether to render an edit link pointing to the repository source
`prev``any`SíPrevious page navigation link
`next``any`SíNext page navigation link

ParsedMarkdown #

Tipo: interface | Ubicación: markdown.ts:78

Result of compiling a Markdown document with frontmatter, HTML, and analytics.

Propiedades #

PropiedadTipoOpcionalDescripción
`frontmatter``Frontmatter`NoExtracted YAML frontmatter metadata
`html``string`NoRendered HTML output with syntax highlighting and callouts
`toc``TocItem[]`NoExtracted Table of Contents hierarchy for the right sidebar
`readingTimeMin``number`NoEstimated reading time in minutes
`wordCount``number`NoTotal word count of the body
`plainText``string`NoPlain text representation used for full-text search indexing

slugify #

Tipo: function | Ubicación: markdown.ts:98

Normalizes a heading string into a URL-safe, accent-free anchor slug.

TYPESCRIPT
function slugify(text: string): string;

Retorna: string — Normalized URL slug

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`text``string`No—Raw heading text

processCodeGroups #

Tipo: function | Ubicación: markdown.ts:251

Transforms VitePress-style ::: code-group blocks into tabbed interactive HTML code panels.

TYPESCRIPT
function processCodeGroups(markdown: string): string;

Retorna: string — Transformed Markdown with HTML tab structures

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content containing code-group directives

processMarkdownIncludes #

Tipo: function | Ubicación: markdown.ts:332

Resolves and inlines Markdown partial includes (<!-- @include: ./partial.md -->)

TYPESCRIPT
function processMarkdownIncludes(markdown: string, baseDir = {}): Promise<string>;

Retorna: Promise<string> — Markdown with included files expanded inline

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content
`baseDir``string`Sí`{}`Base directory used to resolve relative paths

processCodeTransclusions #

Tipo: function | Ubicación: markdown.ts:365

Resolves VitePress-style source code transclusions (<<< @/src/file.ts#L1-L10 [label]) directly from the project repository so code examples never go out of sync.

TYPESCRIPT
function processCodeTransclusions(markdown: string, baseDir = {}): Promise<string>;

Retorna: Promise<string> — Markdown with transcluded source files converted into fenced code blocks

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content
`baseDir``string`Sí`{}`Base directory of the project workspace

processSteps #

Tipo: function | Ubicación: markdown.ts:411

Transforms ::: steps ... ::: containers into a numbered vertical stepper guide.

TYPESCRIPT
function processSteps(markdown: string): string;

Retorna: string — Markdown with stepper containers converted into structured HTML

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content

processContentTabs #

Tipo: function | Ubicación: markdown.ts:438

Transforms ::: tabs ... ::: with @tab Title directives into general-purpose interactive content tabs.

TYPESCRIPT
function processContentTabs(markdown: string): string;

Retorna: string — Markdown with content tabs rendered as accessible tablist panels

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content

processCardsGrid #

Tipo: function | Ubicación: markdown.ts:481

Transforms ::: cards ... ::: directives into a Mintlify/Starlight-style responsive feature card grid. Format per line: - [Title](url) :: Description or - [Icon] [Title](url) :: Description

TYPESCRIPT
function processCardsGrid(markdown: string): string;

Retorna: string — Markdown with card grids converted into HTML cards

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content

processFileTree #

Tipo: function | Ubicación: markdown.ts:519

Transforms ::: file-tree ... ::: containers into a styled directory & file hierarchy tree.

TYPESCRIPT
function processFileTree(markdown: string): string;

Retorna: string — Markdown with file-tree lists rendered with folder and file icons

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content

processMathExpressions #

Tipo: function | Ubicación: markdown.ts:547

Transforms LaTeX mathematical expressions ($$...$$ display blocks and $...$ inline formulas) into semantic math containers for KaTeX rendering, ignoring fenced code blocks and currency values.

TYPESCRIPT
function processMathExpressions(markdown: string): string;

Retorna: string — Markdown with math formulas wrapped in .math-block and .math-inline elements

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`markdown``string`No—Raw Markdown content

parseMarkdown #

Tipo: function | Ubicación: markdown.ts:583

Parses raw Markdown text into structured HTML, extracting frontmatter, TOC, and reading time.

TYPESCRIPT
function parseMarkdown(rawContent: string, baseDir = {}): Promise<ParsedMarkdown>;

Retorna: Promise<ParsedMarkdown> — Promise resolving to the parsed document metadata and HTML

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`rawContent``string`No—Raw Markdown file content including frontmatter
`baseDir``string`Sí`{}`Optional project root directory for resolving code transclusions and includes

SearchDocument #

Tipo: interface | Ubicación: search.ts:1

Represents an indexed document item in the Zerho client-side search engine.

Propiedades #

PropiedadTipoOpcionalDescripción
`id``string`NoUnique document identifier hash or slug
`url``string`NoCanonical link URL
`title``string`NoPrimary document or section title
`section``string`SíSub-section heading title if applicable
`content``string`NoPlain text content indexed for term matching

SearchResult #

Tipo: interface | Ubicación: search.ts:15

Represents a weighted search query hit returned by the search engine.

Propiedades #

PropiedadTipoOpcionalDescripción
`item``SearchDocument`NoThe matching search document
`score``number`NoRelevance score calculated by exact and partial term matches

expandSemanticTerms #

Tipo: function | Ubicación: search.ts:146

Expands primary query terms with semantically related domain synonyms.

TYPESCRIPT
function expandSemanticTerms(primaryTerms: string[]): string[];

Retorna: string[] — Array of semantically related expansion terms not already in primaryTerms

Parámetros #

ParámetroTipoOpcionalDefectoDescripción
`primaryTerms``string[]`No—Cleaned user query terms

SearchIndexer #

Tipo: class | Ubicación: search.ts:168

In-memory client-side and server-side search indexer and query ranking engine.

Propiedades #

PropiedadVisibilidadTipoDescripción
`docs``private``SearchDocument[]`—

Métodos #

`addDocument(doc: SearchDocument): void` #

Adds a document to the search index collection.

ParámetroTipoOpcionalDefectoDescripción
`doc``SearchDocument`No—Search document to index

`getDocuments(): SearchDocument[]` #

Returns a copy of all currently indexed documents.

`toJSON(): string` #

Serializes the search index into formatted JSON for client download.

`static fromJSON(jsonStr: string): SearchIndexer` #

Reconstructs a SearchIndexer instance from serialized JSON.

ParámetroTipoOpcionalDefectoDescripción
`jsonStr``string`No—Serialized JSON documents array

`search(query: string, limit = 10): SearchResult[]` #

Executes a weighted multi-term search query across titles, sections, and bodies.

ParámetroTipoOpcionalDefectoDescripción
`query``string`No—Search keywords or phrase
`limit``number`Sí`10`Maximum number of ranked results to return