Use this when you edit or make new pages. Keep docs plain, short, and easy to scan (not everyone can read). If docs and code disagree, just use the code as reference.
Aim for broad readability so anyone can follow the docs.
Most pages use this shape:
#title.## Summary.- Body sections.
## Related.## Source.
Use ## Next on tutorials. Use ## Limits only when a page needs caps.
Link to Limits and errors instead of copying stuff.
- Use ASCII prose.
- No semicolons in prose.
- A colon introduces a list or a code example. Do not put a sentence after a colon.
- Keep sentences short.
- Keep one idea per sentence when you can.
- Use plain words. Prefer "run on the main thread" over jargon.
- Code blocks, API names, file paths, and error strings can use any characters they need.
- Tag every code fence (
lua,cpp,json,text,bash). Useluafor Luau even though files are.luau. - Reference pages have one section per API.
The pattern is
## api.name, a fenced signature line, short prose, then a fenced example. - Put runnable examples in an
## Examplesection after the body sections and before## Limits. One runnable block per page is enough. Link tomod/demo/*.luaufor longer demos. - Example style: locals at the top, guard clauses like
if not node then return end, keep handles alive while callbacks must run, cancel repeating tasks when done. - Quoting an error string next to its API call is fine. Cap numbers live only in Limits and errors.
- Link to files only.
- Use relative paths like
../reference/lua/globals.md. - Do not link to headings.
- Use the page title as the label. API pages keep their exact lowercase title (
[globals],[mod]). - When several links target one file with different meanings, use distinct short labels instead.
- Link outside the repo when this repo does not own the topic.
- Put shared facts in one place.
- One
#title per page. - Use sentence case.
- Do not skip levels.
- API reference pages may use API names as titles.
- Put three to ten links in
## Related. - Order links closest first, sibling pages, then the parent hub, then cross-cutting pages like Limits and errors.
- Use backtick paths in
## Source. - Omit
## Sourceon pure policy pages. - Tutorials put
## Nextbetween the body and## Related. - Use
## Limitsonly when a page needs caps. One or two sentences, then link Limits and errors.
Do not repeat these topics. Link to the central page.
| Topic | Canonical page |
|---|---|
| Lua module index | globals |
| Require and path rules | modules |
| Signature truth source | type stubs |
| Caps, deadlines, error strings | Limits and errors |
| Codegen overview | Codegen |
| Test map | Testing |
| Mod policy overlay | LuauAPI mod guidelines |
| Main-thread and runtime basics | Getting started |
| C++ host API surface | C++ API reference |
| Native C++ registration | Native C++ registration |
| Hook usage in scripts | hooks |
| Native crash Luau context | Crash sidecar |
| CCObject::release hook safety | Release-hook safety |
| Game object lifetime and refs | game objects |
Keep hook policy in LuauAPI mod guidelines.
When unsure, check these first:
- Generated Luau stubs in
types/geode.d.luauafter a build. - Handwritten stubs in
tools/luau_codegen/extra_bindings/. - C++ under
src/and generated bindings underbuild/luauapi-gen/src/. - Codegen under
tools/luau_codegen/. - Limits in
src/core/Config.hpp.
If behavior changes there then update the docs too.