| Copyright | © 2020-2026 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
- getdocumentation :: LuaError e => StackIndex -> LuaE e Type
- registerDocumentation :: LuaError e => StackIndex -> LuaE e ()
- docsField :: Name
- data ModuleDoc = ModuleDoc {}
- data FunctionDoc = FunDoc {}
- data DocumentationObject
- pushDocumentationObject :: LuaError e => Pusher e DocumentationObject
- peekDocumentationObject :: Peeker e DocumentationObject
- pushModuleDoc :: LuaError e => Pusher e ModuleDoc
- peekModuleDoc :: Peeker e ModuleDoc
- pushFunctionDoc :: LuaError e => Pusher e FunctionDoc
- peekFunctionDoc :: Peeker e FunctionDoc
- pushTypeDoc :: LuaError e => Pusher e FunctionDoc
- peekTypeDoc :: Peeker e TypeDoc
- generateFunctionDocumentation :: Maybe Name -> DocumentedFunction e -> FunctionDoc
- generateModuleDocumentation :: Module e -> ModuleDoc
- generateTypeDocumentation :: DocumentedType e a -> TypeDoc
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.
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
Module documentation
Constructors
| ModuleDoc | |
Fields
| |
Instances
| Show ModuleDoc Source # | |
| Eq ModuleDoc Source # | |
| Ord ModuleDoc Source # | |
Defined in HsLua.Packaging.Types | |
| HasDescription ModuleDoc Source # | |
Defined in HsLua.Packaging.Types | |
data FunctionDoc Source #
Documentation for a Haskell function
Constructors
| FunDoc | |
Fields
| |
Instances
| Show FunctionDoc Source # | |
Defined in HsLua.Packaging.Types | |
| Eq FunctionDoc Source # | |
Defined in HsLua.Packaging.Types Methods (==) :: FunctionDoc -> FunctionDoc -> Bool Source # (/=) :: FunctionDoc -> FunctionDoc -> Bool Source # | |
| Ord FunctionDoc Source # | |
Defined in HsLua.Packaging.Types Methods compare :: FunctionDoc -> FunctionDoc -> Ordering Source # (<) :: FunctionDoc -> FunctionDoc -> Bool Source # (<=) :: FunctionDoc -> FunctionDoc -> Bool Source # (>) :: FunctionDoc -> FunctionDoc -> Bool Source # (>=) :: FunctionDoc -> FunctionDoc -> Bool Source # max :: FunctionDoc -> FunctionDoc -> FunctionDoc Source # min :: FunctionDoc -> FunctionDoc -> FunctionDoc Source # | |
data DocumentationObject Source #
Documentation for any of the supported Lua objects.
Instances
| Show DocumentationObject Source # | |
Defined in HsLua.Packaging.Types | |
| Eq DocumentationObject Source # | |
Defined in HsLua.Packaging.Types Methods (==) :: DocumentationObject -> DocumentationObject -> Bool Source # (/=) :: DocumentationObject -> DocumentationObject -> Bool Source # | |
| Ord DocumentationObject Source # | |
Defined in HsLua.Packaging.Types Methods compare :: DocumentationObject -> DocumentationObject -> Ordering Source # (<) :: DocumentationObject -> DocumentationObject -> Bool Source # (<=) :: DocumentationObject -> DocumentationObject -> Bool Source # (>) :: DocumentationObject -> DocumentationObject -> Bool Source # (>=) :: DocumentationObject -> DocumentationObject -> Bool Source # max :: DocumentationObject -> DocumentationObject -> DocumentationObject Source # min :: DocumentationObject -> DocumentationObject -> DocumentationObject Source # | |
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.