hslua-packaging
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

Instances

Instances details
Show ModuleDoc Source # 
Instance details

Defined in HsLua.Packaging.Types

Methods

showsPrec :: Int -> ModuleDoc -> ShowS

show :: ModuleDoc -> String

showList :: [ModuleDoc] -> ShowS

Eq ModuleDoc Source # 
Instance details

Defined in HsLua.Packaging.Types

Methods

(==) :: ModuleDoc -> ModuleDoc -> Bool

(/=) :: ModuleDoc -> ModuleDoc -> Bool

Ord ModuleDoc Source # 
Instance details

Defined in HsLua.Packaging.Types

Methods

compare :: ModuleDoc -> ModuleDoc -> Ordering

(<) :: ModuleDoc -> ModuleDoc -> Bool

(<=) :: ModuleDoc -> ModuleDoc -> Bool

(>) :: ModuleDoc -> ModuleDoc -> Bool

(>=) :: ModuleDoc -> ModuleDoc -> Bool

max :: ModuleDoc -> ModuleDoc -> ModuleDoc

min :: ModuleDoc -> ModuleDoc -> ModuleDoc

HasDescription ModuleDoc Source # 
Instance details

Defined in HsLua.Packaging.Types

data FunctionDoc Source #

Documentation for a Haskell function

Constructors

FunDoc 

Fields

Instances

Instances details
Show FunctionDoc Source # 
Instance details

Defined in HsLua.Packaging.Types

Methods

showsPrec :: Int -> FunctionDoc -> ShowS

show :: FunctionDoc -> String

showList :: [FunctionDoc] -> ShowS

Eq FunctionDoc Source # 
Instance details

Defined in HsLua.Packaging.Types

Methods

(==) :: FunctionDoc -> FunctionDoc -> Bool

(/=) :: FunctionDoc -> FunctionDoc -> Bool

Ord FunctionDoc Source # 
Instance details

Defined in HsLua.Packaging.Types

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.