Skip to main content

What is it ?

Odt2sphinx converts OpenDocument Text file(s) to one or several .rst files.

Install

You need to install PIL first, then:

pip install odt2sphinx

or

easy_install odt2sphinx

Usage

Usage:
  odt2sphinx [options] filename.odt [targetdir]
  odt2sphinx [options] config.cfg

config.cfg content:
  [path/to/the/file.odt]
  targetdir = path/to/the/targetdir

Options:
  -h, --help            show this help message and exit
  --debug
  --download-source-link

Ouput files

The files are generated in the target dir, which by default has the same name as the .odt file minus the extension.

At least one file, “index.rst”, will be written. Depending on the document content, additional rst files may be generated (see next chapter).

Images are extracted and put together in an “images” directory inside the targetdir.

Styles mapping

The following rules will be applied to particulary styles when converting an .odt file. The style names are case-insensitive.

  • “Title” (in any language) : becomes the main document title (underlined with ‘=’).

  • “Title 1” : Creates a new page named after the title, and becomes this page main title (underlined with ‘=’). A reference to this file is inserted in a .. toctree directive of the index.rst file.

  • “Title 2” to “Title 6” : becomes sub-chapter titles. (underlined respectively ‘-’, ‘~’, ‘^’, ‘”’, “’”)

  • “Warning” (or “Avertissement”) : The chapter becomes the content of a .. warning directive

  • “Tip” (or “Trucs & Astuces”) : The chapter becomes the content of a .. tip directive

  • “Note” or “Information”: The chapter becomes the content of a .. note directive

Changes

0.3.0 (2016-09-28)

  • Switch to Pillow

  • Provides universal wheels

0.2.3 (2012-09-06)

  • Fix filename generation by replacing any non-alphanumeric character (issue #3).

  • Fix handling of non-styled lists.

0.2.2 (2012-07-04)

  • Fix the sdist archive on pypi.

0.2.1 (2012-06-24)

  • Add support for numbered lists, hyperlinks, underlined text (translated to italic).

  • Fix bold text support.

0.2 (2012-05-28)

  • Now supports python 3

  • Explicitely added PIL as a dependency (issue #2).

0.1.2 (2012-05-22)

  • Add “Information” to the styles mapping.

  • Handle note, tip and warning styles in lists items. This allows to use lists inside a note, a tip or a warning.

  • Now handle external images (issue #1).

0.1.1 (2011-12-20)

  • Improved the RstFile for use in third-party code: it is now possible to insert code and not just append it.

  • Add a README file

0.1.0

Initial release

Metadata

Release files for odt2sphinx 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for odt2sphinx 0.3.0
File Size Uploaded
odt2sphinx-0.3.0.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for odt2sphinx 0.3.0
File Interpreter ABI Platform
odt2sphinx-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 24.3 kB

Release files / odt2sphinx-0.3.0.tar.gz

Download URL odt2sphinx-0.3.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1a7f143bcfaa9d58be99be9e069980d40098f56641480d50248042aec02af0e1
BLAKE2b-256 checksum
How to use checksums
2e9b51d72b5b822226f304647907177c7c8c5599e586d3fae2b68731df2503ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / odt2sphinx-0.3.0-py2.py3-none-any.whl

Download URL odt2sphinx-0.3.0-py2.py3-none-any.whl
Size 12.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2b6497ee00e0e0d7c65d9e765eb1f42a5a76fa15f872936d099f2965fb0dd0a0
BLAKE2b-256 checksum
How to use checksums
d6dc234bd430ed213bc04fc0644eb2afcca82c15368de7f9610e3637e5bf7050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page