Generating DITA programmatically?

daudvyd
Posts: 15
Joined: Sun Aug 05, 2018 5:15 am

Generating DITA programmatically?

Post by daudvyd » Mon Oct 14, 2019 8:06 pm

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

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generating DITA programmatically?

Post by Radu » Tue Oct 15, 2019 8:08 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

daudvyd
Posts: 15
Joined: Sun Aug 05, 2018 5:15 am

Re: Generating DITA programmatically?

Post by daudvyd » Tue Oct 15, 2019 9:43 am

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

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generating DITA programmatically?

Post by Radu » Wed Oct 16, 2019 8:02 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply