`.
+
+@string text HTML text
+@treturn string plain text
+]]
function util.htmlToPlainText(text)
-- Replace
and with \n
text = text:gsub("%s*<%s*br%s*/?>%s*", "\n") --
and
diff --git a/plugins/backgroundrunner.koplugin/main.lua b/plugins/backgroundrunner.koplugin/main.lua
index cf45bc813..88cb91951 100644
--- a/plugins/backgroundrunner.koplugin/main.lua
+++ b/plugins/backgroundrunner.koplugin/main.lua
@@ -184,7 +184,7 @@ function BackgroundRunner:_execute()
should_ignore = true
end
elseif type(job.when) == "string" then
- -- TODO(Hzj_jie): Implement "idle" mode
+ --- @todo (Hzj_jie): Implement "idle" mode
if job.when == "best-effort" then
should_execute = (round > 0)
elseif job.when == "idle" then
diff --git a/plugins/calibrecompanion.koplugin/main.lua b/plugins/calibrecompanion.koplugin/main.lua
index e6ff41dcd..8ec7cd137 100644
--- a/plugins/calibrecompanion.koplugin/main.lua
+++ b/plugins/calibrecompanion.koplugin/main.lua
@@ -410,8 +410,8 @@ end
function CalibreCompanion:getFreeSpace(arg)
logger.dbg("FREE_SPACE", arg)
- -- TODO: portable free space calculation?
- -- assume we have 1GB of free space on device
+ --- @todo Portable free space calculation?
+ -- Assume we have 1GB of free space on device.
local free_space = {
free_space_on_device = 1024*1024*1024,
}
diff --git a/plugins/evernote.koplugin/clip.lua b/plugins/evernote.koplugin/clip.lua
index c6c5d3a10..17d5e9e12 100644
--- a/plugins/evernote.koplugin/clip.lua
+++ b/plugins/evernote.koplugin/clip.lua
@@ -248,7 +248,7 @@ function MyClipping:parseHighlight(highlights, book)
image.drawer = item.drawer
clipping.image = self:getImage(image)
end
- -- TODO: store chapter info when exporting highlights
+ --- @todo Store chapter info when exporting highlights.
if clipping.text and clipping.text ~= "" or clipping.image then
table.insert(book, { clipping })
end
diff --git a/plugins/evernote.koplugin/slt2.lua b/plugins/evernote.koplugin/slt2.lua
index f1f1faba3..4cdc78f5f 100644
--- a/plugins/evernote.koplugin/slt2.lua
+++ b/plugins/evernote.koplugin/slt2.lua
@@ -32,7 +32,7 @@ local function include_fold(template, start_tag, end_tag, fold_func, init_func)
local filename = assert(loadstring('return '..string.sub(template, end1 + 1, start2 - 1)))()
assert(filename)
local fin = assert(io.open(filename))
- -- TODO: detect cyclic inclusion?
+ --- @todo Detect cyclic inclusion?
result = fold_func(result, include_fold(fin:read('*a'), start_tag, end_tag, fold_func, init_func), filename)
fin:close()
end
diff --git a/plugins/newsdownloader.koplugin/epubdownloadbackend.lua b/plugins/newsdownloader.koplugin/epubdownloadbackend.lua
index 41a0f38e6..cbc9dce3a 100644
--- a/plugins/newsdownloader.koplugin/epubdownloadbackend.lua
+++ b/plugins/newsdownloader.koplugin/epubdownloadbackend.lua
@@ -382,7 +382,7 @@ function EpubDownloadBackend:createEpub(epub_path, html, url, include_images, me
-- ----------------------------------------------------------------
-- OEBPS/stylesheet.css
- -- TODO: We told it we'd include a stylesheet.css, so it's probably best
+ --- @todo We told it we'd include a stylesheet.css, so it's probably best
-- that we do. In theory, we could try to fetch any *.css files linked in
-- the main html.
epub:add("OEBPS/stylesheet.css", [[
@@ -400,7 +400,7 @@ function EpubDownloadBackend:createEpub(epub_path, html, url, include_images, me
-- Add our own first section for first page, with page name as title
table.insert(toc_ncx_parts, string.format([[%s]], num, num, page_htmltitle))
table.insert(toc_ncx_parts, np_end)
- -- TODO: Not essential for most articles, but longer articles might benefit
+ --- @todo Not essential for most articles, but longer articles might benefit
-- from parsing tags and constructing a proper TOC
while cur_level > 0 do
table.insert(toc_ncx_parts, np_end)
diff --git a/plugins/newsdownloader.koplugin/main.lua b/plugins/newsdownloader.koplugin/main.lua
index 24c692d8a..32d4c7991 100644
--- a/plugins/newsdownloader.koplugin/main.lua
+++ b/plugins/newsdownloader.koplugin/main.lua
@@ -57,7 +57,7 @@ local function getFeedLink(possible_link)
end
end
--- TODO: implement as NetworkMgr:afterWifiAction with configuration options
+--- @todo Implement as NetworkMgr:afterWifiAction with configuration options.
function NewsDownloader:afterWifiAction()
if not wifi_enabled_before_action then
NetworkMgr:promptWifiOff()
diff --git a/plugins/send2ebook.koplugin/main.lua b/plugins/send2ebook.koplugin/main.lua
index 8c8fa4ec4..baf941b04 100644
--- a/plugins/send2ebook.koplugin/main.lua
+++ b/plugins/send2ebook.koplugin/main.lua
@@ -44,7 +44,7 @@ function Send2Ebook:downloadFileAndRemove(connection_url, remote_path, local_dow
end
end
--- TODO: implement as NetworkMgr:afterWifiAction with configuration options
+--- @todo Implement as NetworkMgr:afterWifiAction with configuration options.
function Send2Ebook:afterWifiAction()
if not wifi_enabled_before_action then
NetworkMgr:promptWifiOff()
diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua
index 321c5cb61..22aba0be2 100755
--- a/plugins/statistics.koplugin/main.lua
+++ b/plugins/statistics.koplugin/main.lua
@@ -629,7 +629,7 @@ end
function ReaderStatistics:getBookProperties()
local props = self.view.document:getProps()
if props.title == "No document" or props.title == "" then
- -- FIXME: sometimes crengine returns "No document", try one more time
+ --- @fixme Sometimes crengine returns "No document", try one more time.
props = self.view.document:getProps()
end
return props
diff --git a/plugins/timesync.koplugin/main.lua b/plugins/timesync.koplugin/main.lua
index b83566534..ef675e592 100644
--- a/plugins/timesync.koplugin/main.lua
+++ b/plugins/timesync.koplugin/main.lua
@@ -1,7 +1,7 @@
local Device = require("device")
local command
--- TODO(hzj-jie): Does pocketbook provide ntpdate?
+--- @todo (hzj-jie): Does pocketbook provide ntpdate?
if Device:isKobo() then
command = "ntpd -q -n -p pool.ntp.org"
elseif Device:isCervantes() or Device:isKindle() or Device:isPocketBook() then
diff --git a/plugins/wallabag.koplugin/main.lua b/plugins/wallabag.koplugin/main.lua
index 28d350664..8652df320 100644
--- a/plugins/wallabag.koplugin/main.lua
+++ b/plugins/wallabag.koplugin/main.lua
@@ -1,3 +1,7 @@
+--[[--
+@module koplugin.wallabag
+]]
+
local DataStorage = require("datastorage")
local DocSettings = require("docsettings")
local Event = require("ui/event")
@@ -320,6 +324,9 @@ function Wallabag:getArticleList()
return self:callAPI( "GET", articles_url, nil, "", "" )
end
+--- Download Wallabag article.
+-- @string article
+-- @treturn int 1 failed, 2 skipped, 3 downloaded
function Wallabag:download(article)
local skip_article = false
local item_url = "/api/entries/" .. article.id .. "/export.epub"
@@ -333,7 +340,7 @@ function Wallabag:download(article)
if attr then
-- File already exists, skip it. Preferably only skip if the date of local file is newer than server's.
-- newsdownloader.koplugin has a date parser but it is available only if the plugin is activated.
- -- TODO: find a better solution
+ --- @todo find a better solution
if self.is_dateparser_available then
local server_date = self.dateparser.parse(article.updated_at)
if server_date < attr.modification then
diff --git a/spec/unit/kosync_spec.lua b/spec/unit/kosync_spec.lua
index 33e81281e..3c45f60c4 100644
--- a/spec/unit/kosync_spec.lua
+++ b/spec/unit/kosync_spec.lua
@@ -185,7 +185,7 @@ describe("KOSync modules #notest #nocov", function()
body = {}
}
- -- TODO: Test kosync module
+ --- @todo Test kosync module
local function mockKOSyncClient() --luacheck: ignore
package.loaded["KOSyncClient"] = nil
local c = require("KOSyncClient")
diff --git a/spec/unit/readerbookmark_spec.lua b/spec/unit/readerbookmark_spec.lua
index 3bc934fd1..a7c162192 100644
--- a/spec/unit/readerbookmark_spec.lua
+++ b/spec/unit/readerbookmark_spec.lua
@@ -21,8 +21,7 @@ describe("ReaderBookmark module", function()
readerui.highlight:onHoldRelease()
assert.truthy(readerui.highlight.highlight_dialog)
readerui.highlight:onHighlight()
- -- TODO: replace scheduleIn with nextTick
- UIManager:scheduleIn(1, function()
+ UIManager:nextTick(function()
UIManager:close(readerui.highlight.highlight_dialog)
UIManager:close(readerui)
end)
@@ -30,20 +29,21 @@ describe("ReaderBookmark module", function()
end
local function toggler_dogear(readerui)
readerui.bookmark:onToggleBookmark()
+ --- @todo Replace scheduleIn with nextTick
UIManager:scheduleIn(1, function()
UIManager:close(readerui)
end)
UIManager:run()
end
local function show_bookmark_menu(readerui)
- UIManager:scheduleIn(1, function()
+ UIManager:nextTick(function()
UIManager:close(readerui.bookmark.bookmark_menu)
UIManager:close(readerui)
end)
UIManager:run()
end
- describe("bookmark for EPUB document", function()
+ describe("EPUB document", function()
local readerui
setup(function()
DocSettings:open(sample_epub):purge()
@@ -57,7 +57,7 @@ describe("ReaderBookmark module", function()
UIManager:show(readerui)
readerui.rolling:onGotoPage(10)
end)
- it("should does bookmark comparison properly", function()
+ it("should compare bookmarks properly", function()
assert.truthy(readerui.bookmark:isBookmarkSame(
{ notes = 'foo', page = 1, pos0 = 0, pos1 = 2, },
{ notes = 'foo', page = 1, pos0 = 0, pos1 = 2, }))
@@ -68,13 +68,13 @@ describe("ReaderBookmark module", function()
{ notes = 'foo0', page = 1, pos0 = 0, pos1 = 0, },
{ notes = 'foo', page = 1, pos0 = 0, pos1 = 2, }))
end)
- it("should show dogear after togglering non-bookmarked page", function()
+ it("should show dogear after toggling non-bookmarked page", function()
assert.falsy(readerui.view.dogear_visible)
toggler_dogear(readerui)
Screen:shot("screenshots/reader_bookmark_dogear_epub.png")
assert.truthy(readerui.view.dogear_visible)
end)
- it("should not show dogear after togglering bookmarked page", function()
+ it("should not show dogear after toggling bookmarked page", function()
assert.truthy(readerui.view.dogear_visible)
toggler_dogear(readerui)
Screen:shot("screenshots/reader_bookmark_nodogear_epub.png")
@@ -125,7 +125,7 @@ describe("ReaderBookmark module", function()
end)
end)
- describe("bookmark for PDF document", function()
+ describe("PDF document", function()
local readerui
setup(function()
DocSettings:open(sample_pdf):purge()
@@ -167,12 +167,12 @@ describe("ReaderBookmark module", function()
{ notes = 'foo', pos0 = { page = 1 , x = 1, y = 3},
pos1 = { page = 1, x = 20, y = 2 }, }))
end)
- it("should show dogear after togglering non-bookmarked page", function()
+ it("should show dogear after toggling non-bookmarked page", function()
toggler_dogear(readerui)
Screen:shot("screenshots/reader_bookmark_dogear_pdf.png")
assert.truthy(readerui.view.dogear_visible)
end)
- it("should not show dogear after togglering bookmarked page", function()
+ it("should not show dogear after toggling bookmarked page", function()
toggler_dogear(readerui)
Screen:shot("screenshots/reader_bookmark_nodogear_pdf.png")
assert.truthy(not readerui.view.dogear_visible)
diff --git a/spec/unit/readerhighlight_spec.lua b/spec/unit/readerhighlight_spec.lua
index 1b58560a4..34e39294f 100644
--- a/spec/unit/readerhighlight_spec.lua
+++ b/spec/unit/readerhighlight_spec.lua
@@ -77,8 +77,8 @@ describe("Readerhighlight module", function()
UIManager:quit()
readerui.rolling:onGotoPage(page)
UIManager:show(readerui)
- -- HACK: Mock UIManager:run x and y for readerui.dimen
- -- TODO: refactor readerview's dimen handling so we can get rid of
+ --- @fixme HACK: Mock UIManager:run x and y for readerui.dimen
+ --- @todo Refactor readerview's dimen handling so we can get rid of
-- this workaround
readerui:paintTo(Screen.bb, 0, 0)
end)