mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
[doc, plugin] Exporter: manually specify module name (#10465)
Follow-up to <https://github.com/koreader/koreader/pull/10464>.
This commit is contained in:
@@ -1,28 +1,29 @@
|
|||||||
--[[
|
--[[--
|
||||||
Export highlights to different targets.
|
Export highlights to different targets.
|
||||||
|
|
||||||
Some conventions:
|
Some conventions:
|
||||||
|
|
||||||
- Target: each local format or remote service this plugin can translate to.
|
- Target: each local format or remote service this plugin can translate to.
|
||||||
|
|
||||||
Each new target should inherit from "formats/base" and implement *at least* an export function.
|
Each new target should inherit from "formats/base" and implement *at least* an export function.
|
||||||
|
|
||||||
- Highlight: Text or image in document. Stored in "highlights" table of documents sidecar file.
|
- Highlight: Text or image in document. Stored in "highlights" table of documents sidecar file.
|
||||||
|
|
||||||
Parser uses this table.
|
Parser uses this table.
|
||||||
If highlight._._.text field is empty the parser uses highlight._._.pboxes field to get an image instead.
|
If highlight._._.text field is empty the parser uses highlight._._.pboxes field to get an image instead.
|
||||||
|
|
||||||
- Bookmarks: Data in bookmark explorer. Stored in "bookmarks" table of documents sidecar file.
|
- Bookmarks: Data in bookmark explorer. Stored in "bookmarks" table of documents sidecar file.
|
||||||
|
|
||||||
Every field in bookmarks._ has "text" and "notes" fields.
|
Every field in bookmarks._ has "text" and "notes" fields.
|
||||||
When user edits a highlight or "renames" bookmark the text field is created or updated.
|
When user edits a highlight or "renames" bookmark the text field is created or updated.
|
||||||
The parser looks to bookmarks._.text field for edited notes. bookmarks._.notes isn't used for exporting operations.
|
The parser looks to bookmarks._.text field for edited notes. bookmarks._.notes isn't used for exporting operations.
|
||||||
|
|
||||||
- Clippings: Parsed form of highlights. Single table for all documents.
|
- Clippings: Parsed form of highlights. Single table for all documents.
|
||||||
|
|
||||||
- Booknotes: Every table in clippings table. clippings = {"title" = booknotes}
|
- Booknotes: Every table in clippings table. clippings = {"title" = booknotes}
|
||||||
|
|
||||||
--]]
|
@module koplugin.exporter
|
||||||
|
--]]--
|
||||||
|
|
||||||
local DataStorage = require("datastorage")
|
local DataStorage = require("datastorage")
|
||||||
local Device = require("device")
|
local Device = require("device")
|
||||||
@@ -174,7 +175,7 @@ function Exporter:exportAllNotes()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Parse and export highlights from selected documents.
|
--- Parse and export highlights from selected documents.
|
||||||
-- @tparam table files list of files 'file_path = true'
|
-- @tparam table files list of files as a table of {[file_path] = true}
|
||||||
function Exporter:exportFilesNotes(files)
|
function Exporter:exportFilesNotes(files)
|
||||||
local clippings = self.parser:parseFiles(files)
|
local clippings = self.parser:parseFiles(files)
|
||||||
for title, booknotes in pairs(clippings) do
|
for title, booknotes in pairs(clippings) do
|
||||||
|
|||||||
Reference in New Issue
Block a user