author: | Gerard Marull-Paretas <gerardmarull@gmail.com> |
---|
This extensions allows to render any supported LibreOffice drawing format (e.g. odg, vsd...)
First of all, make sure to have LibreOffice installed.
Warning
LibreOffice 4.3 is known to NOT work. Use other versions instead.
You can install it from PyPI:
$ pip install sphinxcontrib-libreoffice
Alternatively, you can grab it from the sphinx-contrib repository:
$ hg clone https://bitbucket.org/birkenfeld/sphinx-contrib/
$ cd sphinx-contrib/libreoffice
$ python setup.py install
Just add sphinxcontrib.libreoffice to the list of extensions in the conf.py file. For example:
extensions = ['sphinxcontrib.libreoffice']
A quick example:
Code:
.. libreoffice:: test.odg
:align: center
:autocrop:
The optional caption
All options from figure directive can be used (e.g. scale, target...)
Two optional configurations are added to Sphinx. They can be set in conf.py file:
image format used for the different builders. latex and html fromats are supported.
For example:
libreoffice_format = dict(latex='pdf', html='png')
These are the actual defaults.