DITA to Markdown transformation
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 19
- Joined: Wed Aug 24, 2022 7:20 am
DITA to Markdown transformation
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:
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 
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA to Markdown transformation
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:
the produced Markdown content should look like this:
Regards,
Radu
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:
With DITA XML you can nest topics inside each other, so from something like this:However, I couldn't manage to define the title level in DITA files
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>
Code: Select all
# Topic {#introduction}
## Topic2 {#topic_uwh_l41_5xb}
### Topic3 {#topic_ny4_l41_5xb}
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.and there is also an indent issue in the output md file
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 19
- Joined: Wed Aug 24, 2022 7:20 am
Re: DITA to Markdown transformation
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:
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
You do not have the required permissions to view the files attached to this post.
-
- Posts: 19
- Joined: Wed Aug 24, 2022 7:20 am
Re: DITA to Markdown transformation
Here comes another one:
I put a <b></b> tag around a word in the template, like this:
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 
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA to Markdown transformation
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:
Regards,
Radu
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:
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.I put a <b></b> tag around a word in the template...
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Fri Feb 10, 2017 6:00 am
Re: DITA to Markdown transformation
Post 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
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
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA to Markdown transformation
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
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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service