Using Oxygen XML with docs-as-code workflows
Oxygen XML is a robust authoring and publishing tool for technical content that allows you to author in multiple formats (Markdown, HTML, or XML) as well as publish to multiple outputs (HTML-based webhelp, PDF, and more). Although traditionally used for XML authoring and publishing, Oxygen XML has expanded its support with Markdown files, especially with the DITA’s recent support for Lightweight Markdown. In this tutorial, you’ll learn more about Oxygen XML, different workflows you can use to publish in a docs-as-code model, Git integration with Oxygen XML, supported Markdown formats, how to get started, and more.
Note: Oxygen XML is one of the sponsors of my site.
- Publishing workflows with DITA and Markdown in Oxygen XML
- Markdown support
- Git client integration
- More docs-as-code features with Oxygen XML
- Other reasons to explore Oxygen XML
- First steps with Oxygen XML
- Conclusion
- Additional resources
Publishing workflows with DITA and Markdown in Oxygen XML
Although Oxygen XML is most well-known for XML authoring and publishing, Oxygen XML also supports Markdown authoring and publishing. Some of the Markdown support in Oxygen XML is entirely unique among Markdown tools. You can use at least three distinct authoring and publishing workflows with Oxygen XML:
- Workflow #1: Combine DITA and Markdown in the same project
- Workflow #2: Convert Markdown to DITA and publish
- Workflow #3: Convert DITA to Markdown and publish with a static site generator
Workflow #1: Combine DITA and Markdown in the same project
With Oxygen XML, you can reference Markdown files alongside DITA files in your DITA maps. (A DITA map lists the files included in your output and defines the sidebar navigation.) This means you can use Markdown for some content, and DITA for other content, all within the same project. For example, the DITA map might include these references to topics:
<topicref href="files/topic1.dita"/>
<topicref href="files/topic2.md" format="markdown"/>
Why would you want to mix and match format types within the same project? You might have engineers write in Markdown and technical writers write in DITA. Technical writers often have to handle more complex publishing challenges (for which DITA might be more suitable), while external contributors might want simpler needs that can be handled with Markdown alone.
Workflow #2: Convert Markdown to DITA and publish
Another workflow would be to convert Markdown files to DITA syntax. With this workflow, contributors could submit content in Markdown, and tech writers could convert the content into DITA as they pull the content into their projects and then use more advanced reuse features.
This workflow would require tech writers to convert the Markdown files to DITA each time. If the contributor has a later edit and wants to work in Markdown, tech writers could convert the DITA file back to Markdown for the contributor.
Workflow #3: Convert DITA to Markdown and publish with a static site generator
Another workflow could be to publish DITA to Markdown using the DITA Open Toolkit. After obtaining Markdown, you would publish the files using a static site generator (e.g., Hugo, Jekyll, Elevanty, Docusaurus, Gatsby) as the publishing engine.
This publishing engine might be preferable if you have a UX team who wants an extremely customized doc website to match other branding, or perhaps if you have customized templates and Swagger integration for your API reference documentation. Some static site generators like Gatsby offer a robust React-based framework that some UX front-end engineers might prefer to work in, rather than customizing the Oxygen XML webhelp output. Then again, if you don’t have UX and engineering support, creating your own custom doc-themed website might not be appealing to you.
Even within XML projects, many teams use OxygenXML as their editor only (not to also publish). They use the editor to author and edit content, but then connect with another system to handle the publishing.
Markdown support
Because Markdown is the most common format for docs-as-code tools, let’s look in depth at the Markdown authoring experience with Oxygen XML.
Markdown formats supported in Oxygen XML
Oxygen XML provides support for CommonMark Markdown (the same Markdown standard used by the OpenAPI spec) as well MDITA files (Markdown DITA) from the Lightweight DITA (LwDITA) spec. The MDITA format follows GitHub-Flavored Markdown (for example, fenced code blocks with a language identifier) and also incorporates some re-use features from DITA (primarily keyrefs
and conrefs
) — see the supported MDITA syntax here. The keyref
element allows you to use variables in your content, and conref
allows for content re-use (also called transcludes, where you can insert the content from one file into another).
Markdown preview in Oxygen XML’s editor
As you’re writing Markdown in Oxygen XML, a preview pane appears to the right of the code showing how the content will appear in HTML, including image rendering. The preview allows you to view the content you’re working on without rebuilding your entire project to check format rendering. This preview also provides real-time validation checking to make sure your Markdown syntax is correct. Here’s what the Oxygen XML editor looks like:

If you want, you can turn off the HTML preview by right-clicking the preview pane and choosing Hide preview. (You toggle it back on by right-clicking the main window and choosing Show Preview.) You might disable the preview to give you more space to work in the editor, and also to speed up file loading times. Oxygen XML’s editor has a lot of panels that you can undock and rearrange as desired.
In the code view, syntax highlighting colors different parts of the Markdown text to make it more readable. Even some code languages have syntax highlighting directly in the Markdown editor. (The output has full syntax highlighting across code languages.)
In the Project pane on the left, you can also switch to the DITA Map Manager to visually arrange your DITA map, which determines your sidebar navigation. The following screenshot shows how you can either work directly with the DITA map using XML tags or by dragging and dropping the topics in the hierarchical arrangement using the DITA Maps Manager. The Manager gives you a more visual tool to see how topics are nested.

The ability to visually arrange the topics in the DITA Maps Manager is a huge convenience because you can see at a glance how the sidebar navigation will appear, without building your output. Some other docs-as-code tools rely on YAML frontmatter tags or a YAML file itself to manage sidebar navigation, which can be prone to error and extremely fussy with syntax, especially when you have hundreds of topics in your project. (For example, one extra space in a YAML file can cause the required indentation to be malformed.)
Overall, Oxygen XML lets you choose either a direct text editing experience (working in the code) or a visual editor experience, depending on your preference. You can switch back and forth between modes seamlessly, saving a file to see the updates populate into the other view.
Git client integration
Because the Oxygen XML files are all text files, you can manage the content in Git. (In contrast, binary files that are machine-readable can’t be managed in Git.) Although you could manage your Oxygen XML files with Git using your external terminal, Oxygen XML also provides integration with Git directly in the Oxygen XML editor through the Git Client Add-on.
Staging and committing files
When you add the Git Client Add-on, a new Git Staging panel appears in the left pane:

The “Unstaged files” section shows changes you’ve made to files that haven’t been added to the staging area in Git. After selecting the files to stage, click the Stage selected arrow to move it into your staging directory. (Moving these files into the staging area is the equivalent of running
git add <filename>
in the terminal.) The file then appears under Staged files and will be pushed to your Git repository on the next commit.
To commit the files, type a commit message and click Commit. (This is the equivalent of typing git commit -m 'some message'
in the terminal.)
Viewing Git history
Oxygen XML also has additional views for seeing Git history, managing Git branches, and more. For example, to look at the history of commits, go to Window > Show View > Git History. A list of commits then appears in a commit log in the bottom panel:

Managing Git branches
There’s also a Git Branch Manager view that lets you see all the branches and check out a specific branch. Note that the Git functionality within the Git add-on client in Oxygen XML isn’t comprehensive, especially with branch management. For example, while you can create and delete branches, to push these local branches upstream to your remote repository, you’d need to run a command from a terminal (for example, git push --set-upstream origin branchname
). Also, Oxygen XML doesn’t open a terminal directly in the editor. But for the most common Git tasks, the integration is convenient and easy to understand.
Overall, the Git functionality within Oxygen XML brings the most common Git workflows right into your editor, making the authoring experience more seamless and integrated.
More docs-as-code features with Oxygen XML
We’ve covered only a few aspects of docs-as-code tools, namely, Markdown format with text files, and content management with Git. For more details about using Oxygen XML as a docs-as-code tool, see this webinar: Docs as Code - Documentation Management Inspired by Software Development” presented by Alex Jitianu.
The webinar covers ways to store and manage issues with GitHub, how to automate quality checks, how to set up continuous delivery and publishing with Travis CI, ways to collaborate with editing and reviews, and more.
If you’ve never heard the phrase “docs as code,” see Doc-as-code tools for a full description of what this entails. In short, you use the same general tools and workflows to author, manage, and publish documentation as developers use to write code.
Other reasons to explore Oxygen XML
Beyond the docs-as-code features described above, there are other reasons to explore Oxygen XML. Some of these reasons I selected because of my experience in implementing Jekyll while at Amazon. Some features didn’t seem like a big deal at the time (I told myself, we’ll figure it out later) but they proved to be extremely challenging. These features include customizing the theme, generating PDFs, round-tripping translation workflows, and avoiding the temptation to script everything.