Closed stefan-jung closed 2 years ago
@xephon2 when you call DITA-OT, what arguments do you use? Could you add those to the issue description?
@jelovirt, done.
Just to explain @xephon2 's command line, Oxygen uses a custom ANT build file to start an external process which runs the "dita.bat". That "additional.args" parameter is passed to the "dita.bat" command line as it is. In more recent transformation scenarios we have set the value for the "additional.args" parameter to "-verbose -output=out -temp=temp" and I remember we did it to fix something similar, the way in which a relative output file path specified in the project file resolves.
Ok, @raducoravu that makes sense because DITA-OT's Ant API doesn't support project files. Only the DITA-OT CLI supports project files.
@xephon2 - the <output>
path in a <deliverable>
is relative to whatever the DITA-OT's outputdir
directory is, not relative to the project file. This allows each deliverable to declare its relative location in some kind of overall file structure, then that overall file structure can be placed in a destination using outputdir
(or the -o
/--output
option, from the command line).
For example, we take advantage of this to place PDF files in a subdirectory of the WebHelp output directory:
<deliverable id="del-olh-prodA" name="olh-prodA">
<context idref="context-olhA"/>
<output href="olh_A"/>
<publication idref="pub-olh"/>
</deliverable>
<deliverable id="del-pdf-bookA1" name="pdf-bookA1">
<context idref="context-A1"/>
<output href="olh_A/pdf"/>
<publication idref="pub-pdf"/>
</deliverable>
<deliverable id="del-pdf-bookA1" name="pdf-bookA1">
<context idref="context-A1"/>
<output href="olh_A/pdf"/>
<publication idref="pub-pdf"/>
</deliverable>
<deliverable id="del-olh-prodB" name="olh-prodB">
<context idref="context-olhB"/>
<output href="olh_B"/>
<publication idref="pub-olh"/>
</deliverable>
<deliverable id="del-pdf-bookB1" name="pdf-bookB1">
<context idref="context-B1"/>
<output href="olh_B/pdf"/>
<publication idref="pub-pdf"/>
</deliverable>
<deliverable id="del-pdf-bookB1" name="pdf-bookB1">
<context idref="context-B1"/>
<output href="olh_B/pdf"/>
<publication idref="pub-pdf"/>
</deliverable>
This creates an olh_A/ and olh_B/ directory, with a pdf/ subdirectory inside each one for PDFs used by that particular help collection. We then place the entire set of help collections wherever we want with the --output
option.
As @raducoravu mentions, newer Oxygen builds set outputdir
to an "out/" directory within the Oxygen project/repository directory:
I had asked for this change so that Oxygen's default project file publishing behavior was consistent with its non-project-file publishing behavior (which is to put the output in an "out/" directory), and also with the DITA-OT's default publishing behavior (which is also to put the output in an "out/" directory). Otherwise, we were getting output written to inconsistent locations when we switched between Oxygen and Oxygen Publishing Engine with default settings.
Hopefully this helps!
P.S. Also, I see that #3983 is happening for you too.
Great, thanks a lot @jelovirt and @raducoravu and @chrispy-snps for the detailed explanation. Then it works properly. I did not think of that these two output work together (the OT out and the deliverable out).
I'll recheck the docs and will try to send a docs PR to clarify this.
Expected Behavior
I have a DITA-OT project file like this.
I am expecting that
<output>
is relative to the DITA-OT project file itself. But it isn't. In my case it's the root directory of my repository. I don't know if this is expected and I don't know how to change the base directory to get reliable outputs, because.
is not what it seems.First lines of the log:
Actual Behavior
Output files appear randomly somewhere
Possible Solution
I don't know.
Steps to Reproduce
Publish a PDF with a DITA-OT project file and set
<output>
to something like./subdir
.Copy of the error message, log file or stack trace
No error.
Environment