Skip to main content

An OpenDocument to sphinx converter.

Project description

What is it ?

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

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 a “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” : Create 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”: The chapter becomes the content of a .. note directive

Changes

0.1.1

  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for odt2sphinx, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size odt2sphinx-0.1.1.tar.gz (9.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page