docs library
Documentation metadata and renderers for lualike libraries.
Registered libraries can be rendered as a complete HTML reference, a JSON manifest for editor tooling, or LuaLS annotation stubs. Start with documentedLibrariesForRuntime, then pass its result to renderDocsPage, renderDocsJson, or renderLuaLsAnnotations.
final libraries = documentedLibrariesForRuntime(lua.vm);
final json = renderDocsJson(libraries, packageName: 'my_runtime');
Classes
- AliasDescriptor
- Concrete DocDescriptor for a type alias.
- AliasDoc
-
Describes a type alias (
---@alias). - AliasVariant
- A single variant in a string literal union alias.
- ConstantDescriptor
- Concrete DocDescriptor for a constant value.
- DocDescriptor
- A documentation descriptor that pairs with LibraryRegistrationContext.define to declare an exported value's type and metadata.
- DocHtmlResult
- Result of rendering documentation to HTML fragments.
- DocPageOptions
- Options for rendering the shared LuaLike documentation page shell.
- DocParam
- Describes a single parameter accepted by a library function.
- EnumDescriptor
- Concrete DocDescriptor for an enum table.
- EnumDoc
-
Describes an enum table (
---@enum). - FieldDoc
- Describes a single field in a Lua table schema.
- FunctionDescriptor
- Concrete DocDescriptor for a callable function.
- FunctionDoc
- Documentation for a Lua-standard-library function or constant.
- GenericParam
- Declares a generic type parameter on a function or class.
- OperatorDoc
-
Describes a Lua operator metamethod declaration (
---@operator). - OverloadDoc
- An alternative overloaded signature for a function.
- TableDescriptor
- Concrete DocDescriptor for a table schema.
- TableDoc
- Describes the expected shape of a Lua table value.
- ValueDoc
- Documents a constant value or typed global variable.
Enums
- AccessScope
- Controls visibility of functions, fields, and class members in generated LuaLS annotations.
- MetadataFormat
- A generated documentation artifact format.
Functions
-
buildDocsManifest(
List< Library> libraries, {String packageName = 'lualike', String? packageVersion}) → Map<String, Object?> - Builds a stable JSON-serializable manifest for editor tooling.
-
documentedLibrariesForRuntime(
LuaRuntime runtime) → List< Library> - Initializes runtime libraries and returns them in registry order.
-
renderDocs(
List< Library> libraries) → DocHtmlResult - Renders a list of Library objects into sidebar and content HTML.
-
renderDocsJson(
List< Library> libraries, {String packageName = 'lualike', String? packageVersion}) → String - Encodes buildDocsManifest as indented JSON for tools and editors.
-
renderDocsPage(
List< Library> libraries, {DocPageOptions options = const DocPageOptions()}) → String - Renders the shared, complete LuaLike documentation HTML page.
-
renderLuaLsAnnotations(
List< Library> libraries, {String packageName = 'lualike', String? packageVersion}) → String - Renders LuaLS-compatible annotation stubs for the documented libraries.