diff --git a/doc/config.ld b/doc/config.ld index c4438a81b..9e9a4450d 100644 --- a/doc/config.ld +++ b/doc/config.ld @@ -20,7 +20,12 @@ format = 'markdown' sort_modules = true file = { '../frontend', + '../plugins', '../base/ffi', '../platform/android/luajit-launcher/assets', - exclude = {'../base/ffi/sha2.lua'}, + exclude = {'../base/ffi/sha2.lua', + '../plugins/evernote.koplugin/slt2.lua', + '../plugins/newsdownloader.koplugin/lib/handler.lua', + '../plugins/newsdownloader.koplugin/lib/xml.lua', + }, } diff --git a/frontend/dispatcher.lua b/frontend/dispatcher.lua index 1d0bd1c13..e66e15d75 100644 --- a/frontend/dispatcher.lua +++ b/frontend/dispatcher.lua @@ -1,5 +1,28 @@ --[[-- - Dispatcher module +This module is responsible for dispatching events. + +To add a new action an entry must be added to `settingsList` & `dispatcher_menu_order` +This can also be done at runtime via @{registerAction}(). + +`settingsList` contains the list of dispatchable settings. + +Each setting contains: + +* category: one of: + * none: a direct event call + * arg: a event that expects a gesture object or an argument + * absolutenumber: event that sets a number + * incrementalnumber: event that increments a number & accepts a gesture object + * string: event with a list of arguments to chose from +* event: what to call. +* title: for use in ui. +* section: under which menu to display (currently: device, filemanager, rolling, paging) + and optionally +* min/max: for number +* default +* args: allowed values for string. +* toggle: display name for args +* separator: put a separator after in the menu list --]]-- local CreOptions = require("ui/data/creoptions") @@ -15,25 +38,7 @@ local Dispatcher = { initialized = false, } ---[[-- -contains a list of a dispatchable settings -each setting contains: - category: one of - none: a direct event call - arg: a event that expects a gesture object or an argument - absolutenumber: event that sets a number - incrementalnumber: event that increments a number & accepts a gesture object - string: event with a list of arguments to chose from - event: what to call. - title: for use in ui. - section: under which menu to display (currently: device, filemanager, rolling, paging) -and optionally - min/max: for number - default - args: allowed values for string. - toggle: display name for args - separator: put a separator after in the menu list ---]]-- +-- See above for description. local settingsList = { -- Device settings show_frontlight_dialog = { category="none", event="ShowFlDialog", title=_("Show frontlight dialog"), device=true, condition=Device:hasFrontlight(),}, @@ -322,10 +327,20 @@ function Dispatcher:init() end --[[-- - add settings at runtime - @param name: the key to use in the table - @param value: a table per settingsList above. - see helloworld plugin for an example. +Adds settings at runtime. + +@usage + function Hello:onDispatcherRegisterActions() + Dispatcher:registerAction("helloworld_action", {category="none", event="HelloWorld", title=_("Hello World"), filemanager=true,}) + end + + function Hello:init() + self:onDispatcherRegisterActions() + end + + +@param name the key to use in the table +@param value a table per settingsList above --]]-- function Dispatcher:registerAction(name, value) if settingsList[name] == nil then diff --git a/plugins/calibre.koplugin/metadata.lua b/plugins/calibre.koplugin/metadata.lua index 7ebfe871f..e441e33f3 100644 --- a/plugins/calibre.koplugin/metadata.lua +++ b/plugins/calibre.koplugin/metadata.lua @@ -1,10 +1,12 @@ ---[[ - This module implements functions for loading, saving and editing calibre metadata files. +--[[-- +This module implements functions for loading, saving and editing calibre metadata files. - Calibre uses JSON to store metadata on device after each wired transfer. - In wireless transfers calibre sends the same metadata to the client, which is in charge - of storing it. ---]] +Calibre uses JSON to store metadata on device after each wired transfer. +In wireless transfers calibre sends the same metadata to the client, which is in charge +of storing it. + +@module koplugin.calibre.metadata +--]]-- local rapidjson = require("rapidjson") local logger = require("logger") diff --git a/plugins/hello.koplugin/main.lua b/plugins/hello.koplugin/main.lua index a8d820891..658539f63 100644 --- a/plugins/hello.koplugin/main.lua +++ b/plugins/hello.koplugin/main.lua @@ -1,3 +1,9 @@ +--[[-- +This is a debug plugin to test Plugin functionality. + +@module koplugin.HelloWorld +--]]-- + -- This is a debug plugin, remove the following if block to enable it if true then return { disabled = true, }