2018-12-21

how to convert an md file md in odt

You can use pandoc. 
In Linux you can then add to Dolphin menu a new action, like: "pandoc %U -o %u.odt && rename 's/md.odt/odt/g' *"

I prefer this:
"cat %U >> Archivio/$(basename "%u") && sed -i -e 's@<span class="symbol">\&#58771;<\/span>@[\&#58771;]{custom-style="symbol"}@g' -e 's@<span class="symbol">\&#58772;<\/span>@[\&#58772;]{custom-style="symbol"}@g' -e 's@<span class="symbol">\&#58773;<\/span>@[\&#58773;]{custom-style="symbol"}@g' -e 's@<span class="symbol">\&#58774;<\/span>@[\&#58774;]{custom-style="symbol"}@g' %U && pandoc -t odt+smart --lua-filter odt-custom-styles.lua %U -o %u.odt --reference-doc="default.ott" && rename 's/md.odt/odt/g' *

where defaul.ott (LibreOffice defaul template, so that I get an odt file with desired styles) is symlinked from /home to the folder where I have the md files.
Prefer the last pandoc realease, which recognizes filters.

Convert blockquotes

Not:

normal text
> blockqoute
normal text

but

normal text

> blockqoute

normal text

No comments:

Post a Comment

Blog Archive