ODTImport: Import ODT documents into Sigil as epubs.
(based on Writer2LaTeX)
Current Version: "0.5.0"
This plugin is a very simple
Writer2xhtml 1.7.1 wrapper, which allows you to import OpenOffice ODT files.
The author of Writer2xhtml is Henrik Just.
Credits: Since I'm not that familiar with the ODT file format and Writer2LaTeX, I asked
st_albert for help with the configuration and stylesheet files and he kindly provided sample configuration/stylesheet files (config.xml and epub.css) as well as an ODF text document template file (custom-styles.ott).
If you want to test the template file, unzip Custom-Stylesheet.zip and add the custom styles in LibreOffice/OpenOffice via Styles > Load Styles > From file > ODF Text Document Template > custom-styles.ott. This will add a number of custom styles that all start with
custom, e.g.
custom-body-text.
Note that these styles are not intended as all purpose styles, they're merely provided to demonstrate how to map custom styles to stylesheet classes.
For example, the following line in config.xml maps the LibreOffice/OpenOffice
custom-body-text style to the
p.custom-bodytext class in epub.css.
Code:
<xhtml-style-map name="custom-body-text" family="paragraph" element="p" css="custom-bodytext" />
If you don't want to use the default config/css files, you can simply delete them from the plugin folder to force Writer2LaTeX to use the default settings. (To display the ODTImport plugin folder select Edit > Preferences > Open Preferences Location.)
In this case you might find the
RemoveInLineStyles plugin helpful, which will allow you to convert all inline styles to classes.
Warning: Like all other input plugins this plugin will destroy the contents of the currently loaded ePub; make sure to only run it when no epub is loaded.
System requirements:
If you're using an older Sigil version, you'll need to install a Python interpreter and select its path in the Manage Plugins dialog box. Since Writer2LaTeX is a Java app, you'll also need to install Java, if you haven't already done so and the Java executable path must be added to the system path. I.e., if you enter
java -version in a DOS/terminal window you should get a version number. Otherwise the plugin won't work.
If you don't get a version number, please read the
troubleshooting section of the epubcheck (Java) plugin.
Installation
1. Select Manage Plugins from the Plugins menu. In the Manage Plugins dialog box, select
Use Bundled Python, if it isn't already selected. (If your Sigil version doesn't have a
Use Bundled Python option, click one of the Auto buttons to detect the path or Set to manually select the Python interpreter path. )
2. Click Add Plugin and select
ODTImportQt_v0.5.0.zip. This will install the plugin, which you can select via Plugins >
input > ODTImportQt.
(If you're using an older Sigil version install ODTImport_0.4.1.zip.)
Troubleshooting: If you get a
WindowsError: [Error 2] error message, the Java binary couldn't be found. Installing/updating Java and re-booting your machine should take care of this problem.
License: GNU General Public License v3 (GPL-3)