hslua-packaging-2.4.1: Utilities to build Lua modules.
Copyright© 2020-2026 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb@hslua.org>
Safe HaskellNone
LanguageHaskell2010

HsLua.Packaging.Documentation

Description

Provides a function to print documentation if available.

Synopsis

Setting and retrieving documentation

getdocumentation :: LuaError e => StackIndex -> LuaE e Type Source #

Pushes the documentation for the element at the given stack index. Returns the type of the documentation object.

registerDocumentation Source #

Arguments

:: LuaError e 
=> StackIndex
idx
-> LuaE e () 

Registers the object at the top of the stack as documentation for the object at index idx. Pops the documentation of the stack.

docsField :: Name Source #

Name of the registry field holding the documentation table. The documentation table is indexed by the documented objects, like module tables and functions, and contains documentation objects as values.

The table is an ephemeron table, i.e., an entry gets garbage collected if the key is no longer reachable.

Documentation Types

data ModuleDoc Source #

Module documentation

Constructors

ModuleDoc 

Fields

pushDocumentationObject :: LuaError e => Pusher e DocumentationObject Source #

Pushes a DocumentationObject to the Lua stack.

peekDocumentationObject :: Peeker e DocumentationObject Source #

Pushes the metatable for documentation objects.

pushModuleDoc :: LuaError e => Pusher e ModuleDoc Source #

Pushes the documentation of a module as userdata.

peekModuleDoc :: Peeker e ModuleDoc Source #

Retrieves a module documentation object from the Lua stack.

pushFunctionDoc :: LuaError e => Pusher e FunctionDoc Source #

Pushes function documentation as userdata.

peekFunctionDoc :: Peeker e FunctionDoc Source #

Retrieve function documentation from the Lua stack.

pushTypeDoc :: LuaError e => Pusher e FunctionDoc Source #

Pushes documentation type documentation as userdata.

peekTypeDoc :: Peeker e TypeDoc Source #

Retrieve function documentation from the Lua stack.

Creating documentation values

generateFunctionDocumentation :: Maybe Name -> DocumentedFunction e -> FunctionDoc Source #

Generate FunctionDoc documentation for module functions.

generateModuleDocumentation :: Module e -> ModuleDoc Source #

Generate documentation for a module.

generateTypeDocumentation :: DocumentedType e a -> TypeDoc Source #

Generate documentation for a UDType.