2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

[plugin] Exporter: include book author name in myclippings export format (#12106)

This commit is contained in:
Arpan Ghosh 2024-06-28 17:49:08 +05:30 committed by GitHub
parent add783156d
commit e88bfbed97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,19 +16,17 @@ local function format(booknotes)
for ___, entry in ipairs(booknotes) do for ___, entry in ipairs(booknotes) do
for ____, clipping in ipairs(entry) do for ____, clipping in ipairs(entry) do
if booknotes.title and clipping.text then if booknotes.title and clipping.text then
table.insert(tbl, booknotes.title) local title_str = booknotes.title .. " (" .. (booknotes.author or "Unknown") .. ")"
table.insert(tbl, title_str)
local header = T(_("- Your highlight on page %1 | Added on %2"), clipping.page, local header = T(_("- Your highlight on page %1 | Added on %2"), clipping.page,
os.date("%A, %B %d, %Y %I:%M:%S %p", clipping.time)) os.date("%A, %B %d, %Y %I:%M:%S %p", clipping.time))
table.insert(tbl, header) table.insert(tbl, header)
table.insert(tbl, "") table.insert(tbl, "")
table.insert(tbl, clipping.text) table.insert(tbl, clipping.text)
table.insert(tbl, "==========") table.insert(tbl, "==========")
if clipping.note then if clipping.note then
table.insert(tbl, booknotes.title) table.insert(tbl, title_str)
header = T(_("- Your note on page %1 | Added on %2"), clipping.page, header = T(_("- Your note on page %1 | Added on %2"), clipping.page,
os.date("%A, %B %d, %Y %I:%M:%S %p", clipping.time)) os.date("%A, %B %d, %Y %I:%M:%S %p", clipping.time))
table.insert(tbl, header) table.insert(tbl, header)