hslua-packaging-2.1.0: Utilities to build Lua modules.
Copyright© 2020-2022 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Safe HaskellNone
LanguageHaskell2010

HsLua.Packaging.Documentation

Description

Provides a function to print documentation if available.

Synopsis

Documentation

documentation :: LuaError e => DocumentedFunction e Source #

Function that retrieves 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.

pushModuleDoc :: LuaError e => Pusher e (Module e) Source #

Pushes the documentation of a module as a table with string fields name and description.

pushFunctionDoc :: LuaError e => Pusher e (DocumentedFunction e) Source #

Pushes the documentation of a function as a table with string fields, name, description, and since, sequence field parameters, and sequence or string field results.

pushFieldDoc :: LuaError e => Pusher e (Field e) Source #

Pushes the documentation of a field as a table with string fields name and description.

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 strings as values.

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