We electronically control revisions for this topic and deploy it directly online. Any copies you generate from the latest revision are uncontrolled. Ensure you refer to the latest revision online when possible.
Latest revision: /docs-as-code//2020/12/02/converting-documentation.html
Using common tools, we can quickly convert .docx or .tex files to .rst
Pandoc is a great tool to quickly 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. For times when this is not possible, 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