Page 1 of 1

md2dita: prolog in XML author and Ixiasoft different

Posted: Wed May 13, 2020 3:43 pm
by deepbluesea70
Hi there,

I would like to convert markdown files that were created with additional content to be used with the HUGO renderer ( I know this will not be possible completely. Anyway, I noticed that the integrated md2dita converter in XML author can deal with HUGO's so-called frontmatter (metadata between two "---" at the beginning of the document, see below) and convert it into a <prolog> section:

MD Source:

Code: Select all

title: Hibernate a Cluster
description: "Hibernate a Cluster to save money"
type: tutorial-page
level: beginner
category: Operation
scope: operator
tags: ["task"]
aliases: ["/readmore/hibernate"]
publishdate: 2020-04-06

# Hibernate a Cluster

Clusters are only needed
When imported in XML author (version: 21.1) with File -> Open, the md2dita editor converts the frontmatter to dita like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="hibernate-a-cluster">
    <title>Hibernate a Cluster</title>
        <data name="aliases" value="[&#34;/readmore/hibernate&#34;]"/>
        <data name="description" value="&#34;Hibernate a Cluster to save money&#34;"/>
        <data name="level" value="beginner"/>
        <data name="publishdate" value="2020-04-06"/>
        <data name="scope" value="operator"/>
        <data name="tags" value="[&#34;task&#34;]"/>
        <data name="title" value="Hibernate a Cluster"/>
        <data name="type" value="tutorial-page"/>
        <p>Clusters are only needed...
This is very close to what I need: I would like to save metadata about the original MD source in the Ixiasoft DITA CMS.

However, when I try to do the same in Ixiasoft with the integrated version of oXygen (version 20.1), the result looks different:
  • Only the Category metadata is kept. Maybe, because this is a standard element that can be used in the prolog section?
  • The prolog section is not only inserted at the beginning, but also after all following sections.
See screenshot below.

How can I get the same result as in the local XML author? Is the reason for the different result the older XML author version used (20.1. in -Ixiasoft compared to 21.1.)? Or do I miss something and there is some option I need to choose to get the same result?

Ideally, I'd like to get the following <prolog> section:

Code: Select all

        <othermeta content="Hibernate a Cluster" name="title" />
        <othermeta content="Hibernate a Cluster to save money" name="description" />        
        <othermeta content="beginner" name="" /> 
        <othermeta content="beginner" name="level" />   
        <othermeta content="operator" name="scope" />   
        <othermeta content="2020-04-06" name="publishdate" />   
        <othermeta content="tutorial-page" name="type" />   
Thank you
frontmatter-conversion-Ixiasoft.png (132.28 KiB) Viewed 206 times

Re: md2dita: prolog in XML author and Ixiasoft different

Posted: Thu May 14, 2020 12:01 pm
by alex_jitianu

The Markdown to DITA conversion is based on the LwDITA parser for DITA-OT plugin. Oxygen 21.1 comes with a newer version of this plugin which better handles the metadata section.

You can check the plugin's Syntax reference, but I, personally, don't see a way to generate othermeta instead of data. You can use Oxygen's XML Refactoring feature to rename the data elements into othermata

Best regards,

Re: md2dita: prolog in XML author and Ixiasoft different

Posted: Fri May 15, 2020 5:18 pm
by deepbluesea70
Thank you Alex for the explanation!

Best regards,