Page 1 of 1
DITA to Markdown transformation
Posted: Mon Jun 12, 2023 11:16 am
by luodan
Hi there,
We want to use DITA to edit docs and publish it into markdown format, is there a way to customize the formatting of the output?
For example, the following picture shows the expected formatting:
image.png
However, I couldn't manage to define the title level in DITA files, and there is also an indent issue in the output md file:
image.png
image.png
Hope to get your support soon, thanks

Re: DITA to Markdown transformation
Posted: Tue Jun 13, 2023 8:58 am
by Radu
Hi,
Oxygen's DITA to Markdown publishing is done using this third party open source plugin:
https://github.com/jelovirt/org.lwdita
The plugin is installed in the "OXYGEN-INSTALL-DIR/frameworks/dita/DITA-OT3.x" folder and to my knowledge uses XSLT to produce Markdown from DITA XML (OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.lwdita/xsl)
So it's probably possible to make some changes to the XSLTs...
About your initial questions:
However, I couldn't manage to define the title level in DITA files
With DITA XML you can nest topics inside each other, so from something like this:
Code: Select all
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="introduction" translate="no">
<title>Topic</title>
<topic id="topic_uwh_l41_5xb">
<title>Topic2</title>
<topic id="topic_ny4_l41_5xb">
<title>Topic3</title>
</topic>
</topic>
</topic>
the produced Markdown content should look like this:
Code: Select all
# Topic {#introduction}
## Topic2 {#topic_uwh_l41_5xb}
### Topic3 {#topic_ny4_l41_5xb}
and there is also an indent issue in the output md file
How exactly does the DITA XML content look like for those two lists? If you were to write directly those lists in Markdown how would you do that? From what I know plain Markdown cannot be used to represent list items or table cells containing multiple block level elements.
Regards,
Radu
Re: DITA to Markdown transformation
Posted: Wed Jun 14, 2023 10:44 am
by luodan
Hi Radu,
Thanks for pointing out that I could nest topics within each other. Also, I used the embedded scenario transformation module and successfully generated a markdown file.
About the weird indent problem, it turns out that it's a bug of the oxy-placeholder tag, if I use this tag just for placeholder, the Dita file and output file look like this:
image.png
image.png
But when I pass in characters inside the tags, the output file seems just like I expected:
image.png
Re: DITA to Markdown transformation
Posted: Wed Jun 14, 2023 11:47 am
by luodan
Here comes another one:
I put a <b></b> tag around a word in the template, like this:
image.png
But when I create a topic based on that template, the b tag is gone, like this:
image.png
I tried to put a ph tag outside the b tag, but it didn't work

Re: DITA to Markdown transformation
Posted: Wed Jun 14, 2023 1:23 pm
by Radu
Hi,
The "oxy-placeholder" processing instruction is used as a place holder in a new file template, usually people create a DITA topic based on the new file template, fill the place holder values and then they publish. So I do not see a usecase why someone would publish a DITA topic containing those place holders, and thus I'm not sure if this is worth investigating further.
About this other remark:
I put a <b></b> tag around a word in the template...
So you create a new file template for your framework, then use Oxygen's main menu File->"New" wizard dialog to create a DITA topic based on that template? And the created DITA topic does not have a <b> bold element inside it although it was in the file template? In my opinion you may be using to create the topic a different new file template as this should work, Oxygen does not randomly remove content from a new file template file when using it.
Regards,
Radu
Re: DITA to Markdown transformation
Posted: Wed Jun 14, 2023 2:06 pm
by luodan
Yes it's another placeholder issue, when I input actual content to replace the placeholder, it's fine.
Thanks for your help

Re: DITA to Markdown transformation
Posted: Mon Apr 28, 2025 9:04 pm
by laurenkusa
Hi Radu,
for transformation to Markdown from DITA, is
https://github.com/jelovirt/org.lwdita still the way to go? Can i run this from Oxygen following hte steps for installing a plugin?
Thanks,
Lauren
Re: DITA to Markdown transformation
Posted: Tue Apr 29, 2025 6:41 am
by Radu
Hi Laurent,
This particular plugin is indeed the one which is used when publishing DITA to markdown. The plugin comes pre-bundled with the DITA OT which we ship inside the Oxygen installation (you can look in the "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT" for this plugin).
So you can just run DITA to Markdown transformations from the Oxygen DITA Maps Manager view ->'Configure Transformation Scenarios' dialog.
Regards,
Radu