Package: metapensiero.odt2sphinx
What is it?Odt2sphinx converts OpenDocument Text.odtfile(s) to one or several reStructuredText.rstfiles.This is a fork of Christophe de Vienneodt2sphinx.InstallPython3is required!pip3 install metapensiero.odt2sphinxUsageusage: odt2sphinx [-h] [--debug] [--download-source-link] [--embedded-uris]
                  [--ignore-original-column-widths] [--encoding ENCODING]
                  [--test]
                  source [target]

ODT to RST

positional arguments:
  source                Source ODT file to be converted, or a directory
                        containing ODT files and corresponding .expected.rst
                        files in test mode
  target                Either destination directory, a single .rst target
                        filename or "-" for stdout

optional arguments:
  -h, --help            show this help message and exit
  --debug               Emit debug noise
  --download-source-link
                        Add a link to the ODT source file
  --embedded-uris       Emit embedded URIs, instead of anonymous refs
  --ignore-original-column-widths
                        Do not honor the widths of the columns in the original
                        document tables
  --encoding ENCODING   Output encoding, by default UTF-8
  --test                Run in test mode, comparing output with expected reST
                        to be found in “source.expected.rst”Output filesThere are four modes of operation:Sphinx, splitting the source in multiple files, one per chapterMonolithic single plain reST outputStdoutFunctional testThe first mode is selected by omitting the second positional argument, or giving it the name of
a directory. The second is selected by specifying a file name with a.rstextension as the
second positional argument. The third by specifying-as the target name. The latter by
using the--testoption.Multiple files modeThe 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.Images are extracted and put together in an “images” directory inside the targetdir.Monolithic output modeAll the output goes into the single rst file specified as the second positional argument.Images are extracted and put together in an “images” directory inside the directory containing
the output file.Stdout modeNo files are created, even for images: all the output goes tostdout.Functional test modeThis mode is used by the automatic tests: when the--testoption is specified, the tool
loads theexpectedresult from a file with the same name as thesourceone but with the.odtsuffix replaced by.expected.rst.It will print out any discrepancy as aunified diff.Styles mappingThe following rules will be applied to particulary styles when converting an .odt file. The
style names are case-insensitive.TitleBecomes the main document title (over- and underlined with=)SubtitleBecomes the document subtitle (over- and underlined with-)Title 1 … Title 6Becomes sub-chapter titles, underlined respectively with#,=,-,~,+and`; inmultiple files modethe source document is splitted onTitle 1sections
and a reference to the single files is inserted in atoctreedirective in theindex.rstfile“Warning” (or “Avertissement”)The chapter becomes the content of a.. warningdirective“Tip” (or “Trucs & Astuces”)The chapter becomes the content of a.. tipdirective“Note” or “Information”The chapter becomes the content of a.. notedirectiveChanges2.11 (2015-11-28)Support also OpenOfficeFix corner case when a line-break follow empty spaces2.10 (2015-11-26)Better recognition of WMF images2.9 (2015-11-26)Recognizefixedtext also using the font pitchOptimize**bold** **words**as**bold words**2.8 (2015-11-26)Fix error when a table contains empty columns2.7 (2015-11-24)Recurse down document sectionsNew option –ignore-original-column-widths, to produce tighter tables2.6 (2015-11-22)Eliminate font style from spans in Anchors, since the textual part of it is taken verbatim by
docutilsRespect original relative widths of table columns2.5 (2015-11-21)Fix compatibility with Python 3.4Fix rendering of tables with columns span greater than twoAggregate consecutive admonition directives of the same type2.4 (2015-11-19)Fix representation of list item containing a nested listHandle table of contentsBy default hyperlinks are rendered using anonymous refs, the new option--embedded-urisreverts to the old behaviourEliminate excessive newlines from the outputAggregate consecutive similar elements into a single one2.3 (2015-11-17)Unbreak metafile conversion to PNG2.2 (2015-11-17)Convert alsoStarView Metafileimages to PNGFix issue with table rendering2.1 (2015-11-17)Center cell content of header rowsLet the content of multi-rows cell flow thru the separator borderUse LibreOffice to convertWindows Meta Fileimages to PNGRestore handling of –download-source-link option2.0 (2015-11-14)Code overhaul, in particular the reST Writer has been rewritten from scratch and the Visitor
streamlinedreST generation is now done using a stack of objects, easier to understand and to extendhonor the auto-numerated and nested list styleshandle line breaks in paragraphshonor the title and subtitle of the document, using different decorations than those used
for section titlesrespect the styling of the section titlessupport multi-rows header in tableshandle subscript and superscript text stylesNew automatic tests, comparing the output with an expected resultPrint to stdout alternative mode1.1 (2015-11-05)Fix release version, removing the date tag1.0 (2015-11-05)Forked fromhttps://bitbucket.org/cdevienne/odt2sphinxDrop support for Python 2Use Pillow instead of PILRewrap output text for enhanced readabilitySingle monolithic alternative mode0.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 3Explicitely 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 file0.1.0Initial release