Converting documentation

Using common tools, we can quickly convert .docx or .tex files to .rst

Pandoc remains a great tool to convert files between formats.

Although it does the bulk of the work for us, we still need to through the output and clean it up.

To convert PDF/EPS images or images in other formats we can use Magick and Ghostscript.

Ideally, SMEs create and update documentation directly via Sphinx. Failing this, we can use similar commands as below.


pandoc topic.tex -o topic.rst --wrap=none           # Converting base tex files to rst

pandoc document.docx -o document.rst --wrap=none    # Converting docx documents to rst

magick mogrify -trim -format png *.pdf              # Convert all pdf (replace with eps if needed) files within a folder