Compare commits
2 Commits
doc-0.0.0-
...
doc-0.0.0-
| Author | SHA1 | Date | |
|---|---|---|---|
| 76e0d6b65f | |||
| b408cb0d0f |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
diplomarbeitsbuch.pdf
|
diplomarbeitsbuch.pdf
|
||||||
|
defensio.pdf
|
||||||
3
Defensio/puppeteer-config.json
Normal file
3
Defensio/puppeteer-config.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"args": ["--no-sandbox"]
|
||||||
|
}
|
||||||
@@ -151,6 +151,11 @@ local mermaid = {
|
|||||||
compile = function (self, code)
|
compile = function (self, code)
|
||||||
local mime_type = self.mime_type or 'image/svg+xml'
|
local mime_type = self.mime_type or 'image/svg+xml'
|
||||||
local file_extension = extension_for_mimetype[mime_type]
|
local file_extension = extension_for_mimetype[mime_type]
|
||||||
|
|
||||||
|
-- Resolve puppeteer config path
|
||||||
|
local puppeteer_config = pandoc.path.join({pandoc.system.get_working_directory(), 'puppeteer-config.json'})
|
||||||
|
|
||||||
|
|
||||||
return with_temporary_directory("diagram", function (tmpdir)
|
return with_temporary_directory("diagram", function (tmpdir)
|
||||||
return with_working_directory(tmpdir, function ()
|
return with_working_directory(tmpdir, function ()
|
||||||
local infile = 'diagram.mmd'
|
local infile = 'diagram.mmd'
|
||||||
@@ -158,7 +163,7 @@ local mermaid = {
|
|||||||
write_file(infile, code)
|
write_file(infile, code)
|
||||||
pipe(
|
pipe(
|
||||||
self.execpath or 'mmdc',
|
self.execpath or 'mmdc',
|
||||||
{"--pdfFit", "--iconPacksNamesAndUrls", "mdi#https://unpkg.com/@iconify-json/mdi@1.2.3/icons.json", "--input", infile, "--output", outfile},
|
{"--pdfFit", "--iconPacksNamesAndUrls", "mdi#https://unpkg.com/@iconify-json/mdi@1.2.3/icons.json", "-p", puppeteer_config, "--input", infile, "--output", outfile},
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
return read_file(outfile), mime_type
|
return read_file(outfile), mime_type
|
||||||
@@ -167,6 +172,24 @@ local mermaid = {
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Source - https://stackoverflow.com/a/27028488
|
||||||
|
-- Posted by hookenz, modified by community. See post 'Timeline' for change history
|
||||||
|
-- Retrieved 2026-04-18, License - CC BY-SA 4.0
|
||||||
|
|
||||||
|
function dump(o)
|
||||||
|
if type(o) == 'table' then
|
||||||
|
local s = '{ '
|
||||||
|
for k,v in pairs(o) do
|
||||||
|
if type(k) ~= 'number' then k = '"'..k..'"' end
|
||||||
|
s = s .. '['..k..'] = ' .. dump(v) .. ','
|
||||||
|
end
|
||||||
|
return s .. '} '
|
||||||
|
else
|
||||||
|
return tostring(o)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- TikZ
|
--- TikZ
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|||||||
3
puppeteer-config.json
Normal file
3
puppeteer-config.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"args": ["--no-sandbox"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user