diff --git a/src/write.jl b/src/write.jl index 92fd27a..e51344e 100644 --- a/src/write.jl +++ b/src/write.jl @@ -68,8 +68,8 @@ function update_table_style!(unzipped_ppt_dir::String=".") end end -function add_contenttypes!() - path = joinpath("..", "[Content_Types].xml") +function add_contenttypes!(unzipped_ppt_dir::String=".") + path = abspath(joinpath(unzipped_ppt_dir, "..", "[Content_Types].xml")) doc = readxml(path) r = root(doc) extension_contenttypes = ( diff --git a/test/testWriting.jl b/test/testWriting.jl index 63e9da6..2b7fdfe 100644 --- a/test/testWriting.jl +++ b/test/testWriting.jl @@ -112,6 +112,10 @@ end media_dir = joinpath(edited_template_path, "ppt", "media") mkdir(media_dir) + # extra complexity: support read-only template support + # see https://github.com/ASML-Labs/PPTX.jl/issues/45 + chmod(edited_template_path, 0o444; recursive=true) + pres = Presentation(;title="My Presentation") s1 = Slide() julia_logo = Picture(joinpath(PPTX.ASSETS_DIR,"julia_logo.png"), top = 110, left = 110) @@ -124,4 +128,4 @@ end @test isfile(pptx_path) end -end \ No newline at end of file +end