@eryx/eryxdoc Module

JSON

Docgen build engine — the programmatic API.

Use this module when you want to drive eryxdoc from your own script instead of going through main.luau's CLI.

local eryxdoc = require("./eryxdoc")

eryxdoc.build({
	title = "My Docs",
	modules = "./src/modules",
	articles = "./docs",
	output = "./site",
	prefix = "@mylib",
})

Summary

Functions

eryxdoc.build(cfg: Config){ warnings: { string }, moduleCount: number, articleCount: number }

API Reference

Functions

eryxdoc.build

Runs a full documentation build.

eryxdoc.build(cfg: Config){ warnings: { string }, moduleCount: number, articleCount: number }

Parameters

cfg: Config

The build configuration.

Returns

{ warnings: { string }, moduleCount: number, articleCount: number }

{ warnings: { string }, moduleCount: number, articleCount: number }

eryxdoc.getDefaultTheme

eryxdoc.getDefaultTheme()string

Types

PageMeta

Metadata for a single page, used for tags and OpenGraph. Returned by metaGenerator or built from defaults.

description: string?
image: string?
imageAlt: string?
canonicalUrl: string?
type: string?

PageContext

Context passed to the metaGenerator callback so it can decide per-page meta.

kind: "module" | "article" | "index"
name: string?
title: string?
path: string?
summary: string?

OpenGraphConfig

siteName: string?
image: string?
imageAlt: string?
description: string?
type: string?
locale: string?

Config

output: string

Required

modules: string?

Content sources

articles: string?
prefix: string?
noModules: boolean?
title: string?

Site settings

siteRoot: string?
baseUrl: string?
exportMode: ("flat" | "directory")?
theme: string?

Theming

static: string?
favicon: string?

HTML injections

extraHead: string?
extraScripts: string?
announcement: string?
openGraph: OpenGraphConfig?

OpenGraph / SEO

articleMetaGenerator: (((context: PageContext) → PageMeta))?

Optional callbacks that return per-page meta for each page type. Overrides global openGraph defaults for that page. Return nil fields to fall back to the global defaults.

apiMetaGenerator: (((context: PageContext) → PageMeta))?
customFilters: { [string]: ((any, { [string]: any }) → any) }?

Template customisation

customGlobals: { [string]: any }?
version: { name: string, label: string?, isDefault: boolean? }?

Versioning When set, the build output goes into output/{version.name}/ and a versions.json manifest is written/updated at the output root. The version picker in the header reads this manifest.

redirects: { { from: string, to: string } }?

Redirects Each entry generates an HTML redirect stub at the "from" path. Useful when pages are moved to keep old URLs working.

hooks: { onBuildStart: (((cfg: Config) → ()))?, onPageRender: (((html: string, page: { kind: "article" | "module" | "index" | "404", name: string?, path: string }) → string))?, onBuildComplete: (((result: { moduleCount: number, articleCount: number, outputDir: string }) → ()))? }?

Build hooks Callbacks invoked at key points during the build. All are optional.

clean: boolean?

Build options

showLastUpdated: boolean?