- Use the appropriate template from ~/sisstuff/stuff/text/stories/toolbox: story_de.ott for German, story_en.ott for English
- Sanitize the document with the included macro. Run it several times. Make sure that it has //Fin?// and a newline at the end. That’s the marker for the macro to stop.
- Change to Web View in LibreOffice Writer, then select View -> Zoom -> Entire page and save the document. This prevents soft-page-breaks in the resulting XML!
- Unpack the odt to a temporary directory
mkdir tmp
7z x ../the_story.odt
- Transform the file content.xml to xhtml (ignore the version warnings and use the given filter for both german and english stories):
xsltproc ~/sisstuff/stuff/text/filters/stories_en2.xsl content.xml > out.xml
- Remove the namespace from the opening html-tag, otherwise the python script will produce an empty document!
- Remove the string //Fin?// at the bottom of the document. Keep the closing div!
- convert out.xml to story xml:
~/devel/scripts/toxml/conv_with_q.py out.xml > out2.xml
- test out2.xml with xmllint. It should format properly:
xmllint --format out2.xml
- Check out2.xml for double quotes and fix them:
python ~/devel/scripts/toxml/doubleqotes.py out2.xml > out3.xml