What's the Easiest Way to make .docx or .odt Files from Sphinx?

1,812 views
Skip to first unread message

Konstantin Molchanov

unread,
Nov 15, 2016, 2:13:28 AM11/15/16
to sphinx-dev
Hi!

We're making a transition to Sphinx in the company. There are a few issues, but the biggest for now is the lack of an easy way to make MS Word documents.

Quick googling reveals two docx builders for Sphinx, both unmaintained for quite a long time.

I'm sure we're not the first to face this kind of problem. Maybe you guys can suggest an easy way to solve it?

P.S. Both .docx and .odt will do. Basically, as far as it's uploadable to and editable on Google Docs, it's ok.

P.P.S. If nothing better is found, I guess the only way to go is to make pdf with Sphinx and use Pandoc to convert it to docx, which apparently is a journey full of pain and tears.

Guenter Milde

unread,
Nov 15, 2016, 7:36:07 AM11/15/16
to sphin...@googlegroups.com
On 2016-11-15, Konstantin Molchanov wrote:

> We're making a transition to Sphinx in the company. There are a few issues,
> but the biggest for now is the lack of an easy way to make MS Word
> documents.

> Quick googling reveals two docx builders for Sphinx, both unmaintained for
> quite a long time.

There is an odt builder for Docutils (http://docutils.sf.net).
This may help for standalone rST documents without Sphinx specifics.

As Sphinx uses Docutils internally, it may be also a building block for
Sphinx - odt export.

Günter

Konstantin Molchanov

unread,
Nov 15, 2016, 8:13:09 AM11/15/16
to sphinx-dev, mi...@users.sf.net
Thanks for the response. I've found this one too, but, as you noted, it only works with vanilla rst and doesn't support Sphinx's additions, so it's no fir for the task.

Peter Burdine

unread,
Nov 15, 2016, 9:25:08 AM11/15/16
to sphinx-dev, mi...@users.sf.net
While not a straight shot, if you have Adobe Pro, you can produce a PDF then open it in acrobat and convert it to .docx.  I seems to work OK-ish.

Konstantin Molchanov

unread,
Nov 15, 2016, 9:28:50 AM11/15/16
to sphinx-dev, mi...@users.sf.net
I don't have Acrobat Pro, but I've considered using Word for the same purpose. Unfortunately, converting from PDF to other formats works quite poorly. The formatting is lost here and there.

Komiya Takeshi

unread,
Nov 15, 2016, 10:10:37 AM11/15/16
to sphinx-dev
Hi,

AFAIK, there are no extensions to build .docx or .odt directly.
Here is a list of extensions I made at 2 years ago.

So I suggest you to use singlehtml builder to convert your docs to MS-Word.
MS-Word can read HTML document and save it .docx.
That requires manual operation. But it is a sure way to do that at this moment.

Of course it would be nice to make a new extension to export these format :-)

Thanks,
Takeshi KOMIYA

2016年11月15日火曜日 16時13分28秒 UTC+9 Konstantin Molchanov:

mgi...@antmicro.com

unread,
Aug 6, 2017, 9:22:44 AM8/6/17
to sphinx-dev
Hi, as far as I remember https://pypi.python.org/pypi/sphinxcontrib-docxbuilder worked for me for many simple use cases, even though it's in Alpha status. Probably depends on how difficult the documents you're working on are, but probably worth checking out and extending - that would really help the community. 

Cheers
Michael
Reply all
Reply to author
Forward
0 new messages