mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
refactor: handle obsidian uri & templating in lua
This commit is contained in:
@@ -5,8 +5,10 @@ local default_config = {
|
||||
excalidraw = {
|
||||
assetsDir = 'assets',
|
||||
filename = 'drawing-%Y-%m-%d-%H-%M-%S',
|
||||
fileExtension = '.excalidraw.md',
|
||||
fileExtensionInserted = '.excalidraw.svg',
|
||||
obsidianOpenConfig = nil,
|
||||
uriOpenCommand = 'xdg-open',
|
||||
templatePath = nil,
|
||||
},
|
||||
snippets = {
|
||||
enable = true,
|
||||
@@ -22,8 +24,10 @@ local default_config = {
|
||||
|
||||
function M.merge_config(args)
|
||||
M.config = vim.tbl_deep_extend('force', default_config, args or {})
|
||||
M.config.excalidraw.obsidianOpenConfig = M.config.excalidraw.obsidianOpenConfig or
|
||||
M.config.typstarRoot .. '/res/obsidian_open_config_example.json'
|
||||
M.config.excalidraw.templatePath = M.config.excalidraw.templatePath or
|
||||
{
|
||||
['%.excalidraw%.md$'] = M.config.typstarRoot .. '/res/excalidraw_template.excalidraw.md',
|
||||
}
|
||||
end
|
||||
|
||||
M.merge_config(nil)
|
||||
|
||||
Reference in New Issue
Block a user