-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.lua
More file actions
25 lines (20 loc) · 787 Bytes
/
settings.lua
File metadata and controls
25 lines (20 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local DataStorage = require("datastorage")
local LuaSettings = require("luasettings")
DEFAULT_ENABLED = true -- plugin enabled
DEFAULT_WARNING = true -- display confirmation dialog before copying
DEFAULT_MARGIN = 234 -- page margin in pixels
DEFAULT_MODE = "current" -- which page should be changed during copy op
DEFAULT_SIZE = 1 -- font size, 1-3, 1 - small, 2 - large, 3 - medium
DEFAULT_NOTEBOOOK_QUERY = false -- always ask for target notebook before copy operation
local KarmtkaSettings = {
settings = nil
}
function KarmtkaSettings:load(file_name)
self.settings = LuaSettings:open(("%s/%s"):format(DataStorage:getSettingsDir(), file_name))
end
function KarmtkaSettings:save()
if self.settings then
self.settings:flush()
end
end
return KarmtkaSettings