HTML to DITA conversion using the built-in h2d plugin

<oXygen/> general issues.
Posts: 47

HTML to DITA conversion using the built-in h2d plugin

Wed May 25, 2016 7:50 pm

I am trying to get this to work, but don't know what was missing in the process. I was following the instruction here: to automate conversion of Markdown files to HTML and ultimately to DITA, and I had written a script based on the tutorial in the URL, here is the script (I named it ""):

Code: Select all

multimarkdown -f -b *.md
cd /Applications/oxygenAuthor/frameworks/dita/DITA-OT/plugins/h2d ant -Dargs.input=/Users/%user_name%/projects/ditaqrg -Dargs.output=/Users/%user_name%/projects/ditaqrg
cd /Users/%user_name%/projects/ditaqrg

As you can see, this script points to the Oxygen installation directory and to the h2d subdirectory. Supposedly if your script points to the h2d subdirectory, Oxygen should automatically fire up the ant script to process the conversion of html files to DITA, but unfortunately, the process stopped after I ran ./ in the Terminal screen. Although an HTML file was successfully produced, yet the script failed to further generate a DITA file from the HTML. I know I could just simply copy contents from the HTML to Oxygen's editor screen, but I would very much love this process to be automatic, given that I have quite a few Markdown files that I want to batch-process all at once.

Could you point out the error in the script? Or is there something I missed in the process? Thanks.
Posts: 5872

Re: HTML to DITA conversion using the built-in h2d plugin

Thu May 26, 2016 10:42 am


This processing is not related to Oxygen in any way, indeed the DITA OT bundled with Oxygen comes bundled with this h2d plugin which can be used to convert XHTML files to DITA but you can also have an external DITA OT with the same plugin installed.
Ideally you would open in Oxygen the build file:


and get a little bit familiar with what it does. Indeed its main parameters seem to be args.input which can point to a folder and args.output which can also point to the output folder. But it also seems to need a parameter called temp.dir which should point to a folder which is already created on disk, folder in which the temporary conversion results will be saved. So you should also try to send this parameter when starting the ant process.
Also the build file has some file patterns that it uses to identify HTML documents based on the extension. Maybe the extensions of the HTML documents generated in the first stage do not match.
You can also add <echo> tags in the build file and output debug information in the console.

Radu Coravu
<oXygen/> XML Editor
Posts: 47

Re: HTML to DITA conversion using the built-in h2d plugin

Thu May 26, 2016 6:20 pm

Hi Radu:
OK, I'll give that a try, thank you.

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 7 guests