mirror of
https://gitlab.com/upRootNutrition/obsidian.git
synced 2025-06-16 07:25:11 -05:00
feat: 5/10/24 update
This commit is contained in:
parent
e22bd788fe
commit
da37ce527c
32 changed files with 1130 additions and 45001 deletions
|
@ -6,7 +6,9 @@ local url = require('url')
|
|||
local pandoc=pandoc
|
||||
local PANDOC_STATE=PANDOC_STATE
|
||||
|
||||
PANDOC_VERSION:must_be_at_least '2.17'
|
||||
PANDOC_VERSION:must_be_at_least '3.1.7'
|
||||
|
||||
os.text = pandoc.text
|
||||
|
||||
local PATH = pandoc.path
|
||||
local doc_dir = nil
|
||||
|
@ -22,7 +24,7 @@ if PANDOC_STATE.output_file then
|
|||
local output_file = PANDOC_STATE.output_file
|
||||
doc_dir = PATH.directory(output_file)
|
||||
if PANDOC_WRITER_OPTIONS.variables["media_dir"] then
|
||||
media_dir = PANDOC_WRITER_OPTIONS.variables["media_dir"]
|
||||
media_dir = tostring(PANDOC_WRITER_OPTIONS.variables["media_dir"])
|
||||
else
|
||||
media_dir = PATH.split_extension(output_file)
|
||||
if Mode ~= 'hugo' then
|
||||
|
|
|
@ -3,7 +3,6 @@ if os.platform == nil then
|
|||
local libExt = package.cpath:match("%p[\\|/]?\\.%p(%a+)")
|
||||
if libExt == 'dll' then
|
||||
os.platform = "Windows"
|
||||
require"utf8_filenames"
|
||||
elseif libExt == 'so' then
|
||||
os.platform = "Linux"
|
||||
elseif libExt == 'dylib' then
|
||||
|
@ -15,7 +14,9 @@ end
|
|||
os.copy = function(src, dest)
|
||||
if os.platform == "Windows" then
|
||||
src = string.gsub(src, "/", "\\")
|
||||
os.execute('copy "' .. src .. '" "' .. dest .. '"')
|
||||
src = os.text.toencoding(src)
|
||||
dest = os.text.toencoding(dest)
|
||||
os.execute('copy "' .. src .. '" "' .. dest .. '" >NUL')
|
||||
else
|
||||
os.execute('cp "' .. src .. '" "' .. dest .. '"')
|
||||
end
|
||||
|
@ -26,6 +27,7 @@ os.mkdir = function(dir)
|
|||
return
|
||||
end
|
||||
if os.platform == "Windows" then
|
||||
dir = os.text.toencoding(dir)
|
||||
os.execute('mkdir "' .. dir .. '"')
|
||||
else
|
||||
os.execute('mkdir -p "' .. dir .. '"')
|
||||
|
@ -35,6 +37,7 @@ end
|
|||
os.exists = function(path)
|
||||
if os.platform == "Windows" then
|
||||
path = string.gsub(path, "/", "\\")
|
||||
path = os.text.toencoding(path)
|
||||
local _, _, code = os.execute('if exist "' .. path .. '" (exit 0) else (exit 1)')
|
||||
return code == 0
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue