From 815c5924e3a154d46b1252e4451f41a1e007461d Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Wed, 17 Feb 2016 21:05:07 -0800 Subject: [PATCH] add documentation for wbuilder --- doc/Hacking.md | 23 +++++++++++++++++++++++ doc/config.ld | 2 +- utils/wbuilder.lua | 3 +-- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 doc/Hacking.md diff --git a/doc/Hacking.md b/doc/Hacking.md new file mode 100644 index 000000000..45aa0bcb7 --- /dev/null +++ b/doc/Hacking.md @@ -0,0 +1,23 @@ +Hacking +======= + +Developing UI Widgets +--------------------- + +If you need to create new UI widgets, `utils/wbuilder.lua` is your friend. It +sets up a minimal environment to bootstrap KOReader's UI framework to avoid +starting the whole reader. This gives you quick feedback loop while iterating +through your widget changes. + +To get a taste of how it works, try running this command at the root of +KOReader's source tree: + +``` +./kodev wbuilder +``` + +It will spawn up an emulator window with a grid and simple timer widget for +demonstration. + +You can add your own `UIManager:show` show call at the end of +`utils/wbuilder.lua` to test your new widget. diff --git a/doc/config.ld b/doc/config.ld index bd70251b1..9fa5fd846 100644 --- a/doc/config.ld +++ b/doc/config.ld @@ -5,7 +5,7 @@ title = 'KOReader Documentation' dir = 'html' style = '!fixed' use_markdown_titles = true -readme = '../README.md' +topics = {'../README.md', './Hacking.md'} package = '' format = 'markdown' sort_modules = true diff --git a/utils/wbuilder.lua b/utils/wbuilder.lua index c6122d004..51be431e1 100755 --- a/utils/wbuilder.lua +++ b/utils/wbuilder.lua @@ -385,7 +385,6 @@ UIManager:show(Clock:new()) --UIManager:show(keyboard) --UIManager:show(TestInputText) --TestInputText:onShowKeyboard() - -UIManager:show(kvp) +--UIManager:show(kvp) UIManager:run()