You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sample demonstrates a few issues with generate.copy.outer=1 but the most significant is that I've found a way to generate files outside of the designated output directory. I ran into this with a user document in 2.3.1, but have reproduced in 2.4 now.
My map structure looks odd and is presented here as a simple test case - but variants of this exist in our real documentation. I have a map nested down in sub1/sub2/. It references a topic and an HTML file in the same directory; the topic references an image in the same directory. Trouble comes with the uplevels reference to wayup.dita:
I've run two builds to html5; the builds match except for generate.copy.outer, which I've tried as both "1" and "3".
Results in this zip along with source: outdirs.zip
"3" seems to work. index.html is generated in the output equivalent of the main directory. Image and HTML file are properly copied to the same directory, and the image appears in maindir.html. Links between topics work.
"1" demonstrates several problems. Most significant: the image is copied outside of the output directory. The uplevels variable here (on Windows) is set to ..\..\ because there is a topic 2 levels up from the map. The image's output directory is constructed as:
The image itself is stored in the .job.xml file as sub1/sub2/end.jpg. As a result, the generated image path for this file becomes out + uplevels + path-and-file: out/../../sub1/sub2/end.jpg
I think what's actually wanted, but I'm not sure how to get it, would be output dir + path to image + uplevels + file name.
Other issues:
index.html and CSS are placed directly in the output directory as expected. Index file links to other files as if they are there
Generated topic from the main dir is placed within sub1/sub2/ in the output directory
I think I have a simpler than expected fix for this. It fixes the image issue for XHTML and HTML5 with the attached samples. It does not fix the other issues mentioned at the end of my original description.
With the current develop code, I updated the copy-image task as follows; the image is now placed in the proper location relative to the main topic (nothing is placed outside the designated output directory):
Assuming #2670 is accepted, this will need another update to account for that change, so I haven't yet created a branch / pull request for this one. But, I'd like to get it into 2.5.
@infotexture draft summary for release notes: "In some cases, referencing topics outside of the map directory resulted in images being copied outside of the specified output directory. Processing has been updated so that images are placed in the correct location inside the specified output directory."
This sample demonstrates a few issues with
generate.copy.outer=1
but the most significant is that I've found a way to generate files outside of the designated output directory. I ran into this with a user document in 2.3.1, but have reproduced in 2.4 now.My map structure looks odd and is presented here as a simple test case - but variants of this exist in our real documentation. I have a map nested down in
sub1/sub2/
. It references a topic and an HTML file in the same directory; the topic references an image in the same directory. Trouble comes with the uplevels reference towayup.dita
:I've run two builds to
html5
; the builds match except forgenerate.copy.outer
, which I've tried as both "1" and "3".Results in this zip along with source:
outdirs.zip
"3" seems to work.
index.html
is generated in the output equivalent of the main directory. Image and HTML file are properly copied to the same directory, and the image appears inmaindir.html
. Links between topics work."1" demonstrates several problems. Most significant: the image is copied outside of the output directory. The
uplevels
variable here (on Windows) is set to..\..\
because there is a topic 2 levels up from the map. The image's output directory is constructed as:The image itself is stored in the
.job.xml
file assub1/sub2/end.jpg
. As a result, the generated image path for this file becomes out + uplevels + path-and-file:out/../../sub1/sub2/end.jpg
I think what's actually wanted, but I'm not sure how to get it, would be output dir + path to image + uplevels + file name.
Other issues:
index.html
and CSS are placed directly in the output directory as expected. Index file links to other files as if they are theresub1/sub2/
in the output directorysub1/sub2/
inside the output directory - related to Update copy-html to work like copy-image, with parameter for destination directory #1964, but I think the fix I suggested there would end up causing the issue seen with images (copy outside)The text was updated successfully, but these errors were encountered: