hslua-packaging-2.3.1: Utilities to build Lua modules.

Copyright | © 2020-2024 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@hslua.org>
Safe Haskell | None
Language | Haskell2010

HsLua.Packaging.Documentation

Description

Provides a function to print documentation if available.

Synopsis

- documentation :: LuaError e => DocumentedFunction e
- getdocumentation :: LuaError e => StackIndex -> LuaE e Type
- registerDocumentation :: LuaError e => StackIndex -> LuaE e ()
- pushModuleDoc :: LuaError e => Pusher e (Module e)
- pushFunctionDoc :: LuaError e => Pusher e (DocumentedFunction e)
- pushFieldDoc :: LuaError e => Pusher e (Field e)
- docsField :: Name

# 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.