Page 1 of 1

Generating DITA programmatically?

Posted: Mon Oct 14, 2019 8:06 pm
by daudvyd
Hi folks,

I wrote a Python program that generates content (paragraphs, tables, figures) for a project. I'd like to improve the program so that it adds XML tags and generates DITA maps and draft documents. I would then load these documents into Oxygen for final editing and conversion to PDF. Is anyone generating DITA content programmatically (via computer code) who could recommend an approach or specific Python library?

-da'ud vyd

Re: Generating DITA programmatically?

Posted: Tue Oct 15, 2019 8:08 am
by Radu
Hi,

The Oxygen forum is kind of a static place, we have many registered users but most of them receive notifications only on the threads that they started. If you want opinions from the DITA community maybe you can register and ask on the DITA Users List (Yahoo Group).
About your particular use case, we (the Oxygen team) do not have much experience with Python, if you already generate that content in some format (not necessarily in DITA) for example in HTML there are conversion stylesheets which can convert the HTML to DITA. So your Python script could remain the same but then add an XSLT conversion for HTML to DITA or use Oxygen's free add-on which can convert a bunch of formats to DITA:

https://github.com/oxygenxml/oxygen-resources-converter

Regards,
Radu

Re: Generating DITA programmatically?

Posted: Tue Oct 15, 2019 9:43 am
by daudvyd
Thank you Radu. I've posted to the Yahoo forum. It is easy for me to generate Word (docx) files via Python. I notice that the Oxygen Batch Converter support for Word is "experimental". What are its weaknesses? How would I specify which material should be printed in one column and which material should be printed in two columns? Markdown is also a possibility, though I know little about it.

-da'ud vyd

Re: Generating DITA programmatically?

Posted: Wed Oct 16, 2019 8:02 am
by Radu
Hi Da'ud,

Please see some answers below:
I notice that the Oxygen Batch Converter support for Word is "experimental". What are its weaknesses?
From what I remember we still have some work to do on converting MathML equations from Word documents to DITA. We'll get this done in Oxygen 22 (January next year).
How would I specify which material should be printed in one column and which material should be printed in two columns?


Assuming that you will use our DITA to PDF output based on CSS, you can mark the DITA topics which should be printed on two columns with the 'outputclass=two_columns' attribute and then create a small custom CSS to print it on two columns:

https://www.oxygenxml.com/doc/versions/ ... ayout.html

Regards,
Radu