DOCXImport: Import DOCX documents into Sigil as epubs.
(based on the Python
Mammoth module)
** NOTE: this plugin periodically checks for updated versions by connecting to github (where the source is maintained). **
(this update check can be disabled via the GUI)
Minimum Sigil requirement: v0.9.0 or higher
Python Requirements: Python 3.4+ (Bundled or external)
OS Requirements: Windows/Linux/OS X
*** Linux users will have to make sure that the PyQt5 graphical python module (or PySide6 starting with Sigil 2.0) is present if it's not already. On Debian-based flavors this can be done with "sudo apt-get install python3-pyqt5" (or pip install PySide6). On Arch distributions it can be done with pacman -S python-pyqt5 and/or pacman -S pyside6***
*Note: Do not rename any Sigil plugin zip files before attempting to install them *
Select a pre-existing DOCX file using the file dialog and it will be imported as a single-file epub.
The following features are currently supported (provided by Mammoth):
- Headings.
- Lists.
- Customisable mapping from your own docx styles to HTML. For instance, you could convert WarningHeading to h1.warning by providing an appropriate style mapping.
- Tables. The formatting of the table itself, such as borders, is currently ignored, but the formatting of the text is treated the same as in the rest of the document.
- Footnotes and endnotes.
- Images **NOTE: WMF/EMF images are unsupported and will be ignored.**
- Bold, italics, underlines, strikethrough, superscript and subscript.
- Links.
- Line breaks.
- Text boxes. The contents of the text box are treated as a separate paragraph that appears after the paragraph containing the text box.
An example of a style map (as well as a sample docx and css file file it will work with) are in the samples.zip attached to this post. More info on writing custom style maps can be found in the "Writing Style maps" section of
Mammoth's README.
DOCXImport's code is hosted/maintained
on Github.
The very latest version (and all previous versions) of DOCXImport can always be found on its
Github Releases Page.
Changes
Spoiler:
v0.1.0
- Initial release
v0.2.0
- added gui
- added ability to employ custom style maps and custom css files
- dropped Python 2.7.x support
v0.2.1
- fixed some widget clipping situations
- changed icon
v0.2.2
- corrected some non-compliant opf issues when importing as EPUB3
v0.2.3
- use PyQt5 GUI if Sigil is new enough.
- integrate upstream changes to mammoth module
v0.2.4
- Update mammoth/cobble modules to latest upstream
- Tweak mammoth to create a "title" attribute for images if the title property is defined in the docx
- Remove extraneous parsimonious module
v0.2.5
- Add empty alt attribute to images when no alt_text/descr is provided in the DOCX
v0.2.6
- Fix empty paragraph regex bug (thanks @BeckyEbook)
v0.2.7
- Update upstream Mammoth library
- Add support to match Sigil's light/dark theme in Sigil 1.1
- Re-enable translation support (translator's wanted)
v0.2.8
- Import to a flat archive structure; Sigil 1.0+ users can restructure as they wish
v0.3.0
- Dropped Support for tkinter
- Fix to work with Qt6.5.2 and Python 3.11.3 for Sigil 2.0