15. Mai 2023 um 08:27 Uhr

Convert a LibreOffice (odt) file to AsciiDoc

While the asciidoc documentation has an answer to the question how to convert a Microsoft Word file to AsciiDoc, there is no hint on how to do that for ODT (OpenDocument aka LibreOffice or OpenOffice) files.

Sure, one possibility is to safe it in word format and then use pandoc as sugested in the article linked above.

But I was interested to learn if there is an option without such a step that introtuces also the risk to loosing some document details due to incapablities to the intermedieate format or due to the additinal converter involved.

I found the Open Document Converter for AsciiDoc but that one is meant to produce ODT from Asciidoc.

A direct option to convert can be deducted from the command used in the article linked first, it would be:

pandoc -f odt -t asciidoc Dokument.odt -o Dokument.adoc

Nice. But looking at the result, I had the desire to check if there are better results possible.

Another option that came to my mind and that also avoids Microsoft technology is to use HTML a the intermediate format:

/Applications/ --convert-to html document.odt --outdir .

After that, we need to use Pandoc, a generic document converter:

pandoc -f html -t asciidoc document.html -o document.adoc

Big benefit of this step is, that all embedded media was exported and seperately saved. By this, its much easiert to adopt it to the new document.

Einen Kommentar schreiben

Gravatar unterstützt wird erstellt mit WordPress
Beiträge (RSS) und Kommentare (RSS)

(c) 2005 - 2023 Markus Schlichting - Mastodon