Getting Started
LuauDocs builds a VitePress documentation site from your Luau library. It discovers exports from what your modules return and reads signatures from your type annotations. You get full-text search, dark mode, and cross-linked types without adding doc tags or writing upfront config.
Requirements
You need Node.js 22.12 or newer.
LuauDocs uses Lute to parse and evaluate your Luau source files. It downloads and caches a pinned Lute binary automatically on first run. For offline environments, point LUAUDOCS_LUTE at a local binary.
Install
npm i -g luaudocs# tracks the latest commit
npm i -g github:kohltastrophe/luaudocsYour first site
cd my-luau-library && luaudocs devdev starts a local server and prints a localhost URL for your API reference.
If you don't have a luaudocs.toml file, LuauDocs uses sensible defaults. It takes the site title from your folder name and reads modules from src/ and lib/. You can configure other paths under [source] entries. If .luaudocs/ doesn't exist yet, the build creates it with a .gitignore for build artifacts so only your own files are ready to commit.
Leave dev running while you edit doc comments to see live updates in place.
What you get
This site documents examples/Flux using those defaults:
local State = require("@self/State")
local Util = require("@self/Util")
--[[ A tiny reactive state library. ]]
local Flux = {}
Flux.State = State
Flux.Util = Util
--[[ Reports whether `value` is a state. ]]
Flux.isState = State.isState
--[[
Creates a state holding `initial`.
Call the state to read it, and see [State:Connect] for reacting to changes.
]]
function Flux.state<T>(initial: T?): State.State<T>
return State.new(initial)
end
return FluxHere is the generated page for that module, embedded directly from the emitted markdown:
Properties
State Module
Flux.State: StateUtil Module
Flux.Util: UtilFunctions
state
Flux.state<T>(initial: T?): State.State<T>Creates a state holding initial.
Call the state to read it, and see State:Connect for reacting to changes.
isState from State
Flux.isState(value: any): booleanReports whether value is a state.
From return Flux alone, LuauDocs infers:
- Required modules become pages. They carry a Module badge and nest under Flux in the sidebar to match caller access paths (
Flux.StateandFlux.Util). isStateis documented under its exposed name. It gets a from State badge that links to its definition.- Signatures come from your annotations.
State.Statelinks directly to its type entry. [State:Connect]resolves to a link because a project module declares it.
Browse the full example library under Example API, where modules nest by access path (Flux → Util → Queue). See How It Works for the rules behind surface discovery and sidebar layout.
Commands
Each command takes an optional project directory (defaults to .):
luaudocs dev: watches sources and serves a live preview.luaudocs build: builds the static site for publishing. See Deploying.luaudocs init: scaffoldsluaudocs.tomland starter pages. See Configuration.luaudocs llms: writes a repository-rootllms.txtfor coding agents. See Coding Agents.
Pass -h / --help or see Reference: CLI for all flags.
Next steps
- How It Works: how public surface discovery shapes your site.
- Writing Doc Comments: prose and automatic cross-references.
- Configuration:
luaudocs.toml, file ownership, and styling. - Deploying: GitHub Pages and Cloudflare Pages setup.
- Coding Agents: generating
llms.txtindexes for coding agents. - Migrating from Moonwave: run
luaudocs init --from-moonwaveto convert your config, guides, and static assets while keeping all 24 Moonwave tags.