Add example docs for LDoc

This commit is contained in:
Insality
2019-09-25 20:40:41 +03:00
parent 4d424a34c2
commit b72e7451e1
14 changed files with 92 additions and 35 deletions

View File

@@ -1,3 +1,9 @@
--- Druid UI Library.
-- Component based UI library to make your life easier.
-- Contains a lot of base components and give API
-- to create your own rich components.
-- @module druid
local data = require("druid.data")
local druid_input = require("druid.helper.druid_input")
local settings = require("druid.settings")
@@ -7,6 +13,7 @@ local M = {}
local log = settings.log
local _fct_metatable = {}
--- Basic components
M.comps = {
button = require("druid.base.button"),
back_handler = require("druid.base.back_handler"),
@@ -31,6 +38,9 @@ local function register_basic_components()
end
--- Register external module
-- @tparam string name module name
-- @tparam table module lua table with module
function M.register(name, module)
-- TODO: Find better solution to creating elements?
_fct_metatable["new_" .. name] = function(self, ...)
@@ -209,4 +219,4 @@ function _fct_metatable.update(self, dt)
end
return M
return M