diff options
author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2023-04-19 23:31:31 +0000 |
---|---|---|
committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2023-04-19 23:31:31 +0000 |
commit | 6850dcd1240e8d5817d7bfe14874a86ecedb7c9a (patch) | |
tree | a5a2a88e12fec88b69ca37012b52e5e84932c4bc | |
parent | 690c4cc2cf6867e68485e044938efaf9e5cfdd46 (diff) | |
download | docutils-6850dcd1240e8d5817d7bfe14874a86ecedb7c9a.tar.gz |
Small fixes to odt_prepstyles module.
Add link to the full documentation to "usage".
Specify encoding when writing to zipfile.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9360 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rwxr-xr-x | docutils/tools/rst2odt_prepstyles.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docutils/tools/rst2odt_prepstyles.py b/docutils/tools/rst2odt_prepstyles.py index 0ac9a3340..640383e30 100755 --- a/docutils/tools/rst2odt_prepstyles.py +++ b/docutils/tools/rst2odt_prepstyles.py @@ -5,8 +5,10 @@ # Copyright: This module has been placed in the public domain. """ -Fix a word-processor-generated styles.odt for odtwriter use: Drop page size -specifications from styles.xml in STYLE_FILE.odt. +Adapt a word-processor-generated styles.odt for odtwriter use: + +Drop page size specifications from styles.xml in STYLE_FILE.odt. +See https://docutils.sourceforge.io/docs/user/odt.html#page-size """ # Author: Michael Schutte <michi@uiae.at> @@ -42,7 +44,7 @@ def prepstyle(filename): for item in zin.infolist(): if item.filename == "styles.xml": - zout.writestr(item, etree.tostring(root)) + zout.writestr(item, etree.tostring(root, encoding="UTF-8")) else: zout.writestr(item, zin.read(item.filename)) |