mirror of
https://github.com/TangentFoxy/.lua-files.git
synced 2024-11-20 21:34:23 +00:00
shitty pdf converter added
This commit is contained in:
parent
bb17d100d2
commit
bfc44da3d3
14
2pdf.lua
Normal file
14
2pdf.lua
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env luajit
|
||||
|
||||
-- The first time this is run (on Windows), a dialog will appear.
|
||||
-- Uncheck the "always show this" thing and click Install.
|
||||
|
||||
local error_occurred, utility = pcall(function() return dofile(arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)") .. "utility-functions.lua") end) if not error_occurred then error("\n\nThis script is installed improperly. Follow instructions at:\n\thttps://github.com/TangentFoxy/.lua-files#installation\n") end
|
||||
|
||||
local for_files = utility.ls()
|
||||
os.execute("mkdir 2pdf-output")
|
||||
|
||||
for_files(function(file_name)
|
||||
local name_sans_extension = file_name:sub(1, -5) -- temporarily hardcoding expectation that the input file has a 3-digit file extension
|
||||
os.execute("pandoc \"" .. file_name .. "\" -o \"2pdf-output/" .. name_sans_extension .. ".pdf\"")
|
||||
end)
|
Loading…
Reference in New Issue
Block a user