{"id":669,"date":"2019-12-15T08:32:06","date_gmt":"2019-12-15T07:32:06","guid":{"rendered":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=669"},"modified":"2024-09-09T08:57:36","modified_gmt":"2024-09-09T07:57:36","slug":"write-a-story","status":"publish","type":"post","link":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=669","title":{"rendered":"Write a story"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li>Use the appropriate template from ~\/sisstuff\/stuff\/text\/stories\/toolbox: story_de.ott for German, story_en.ott for English<\/li>\n\n\n\n<li>Sanitize the document with the included macro. Run it several times. Make sure that it has \/\/Fin?\/\/ and a newline at the end. That&#8217;s the marker for the macro to stop.<\/li>\n\n\n\n<li>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!<\/li>\n\n\n\n<li>Unpack the odt to a temporary directory<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir tmp\n7z x ..\/the_story.odt<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Transform the file content.xml to xhtml (ignore the version warnings and use the given filter for both german and english stories):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">xsltproc ~\/sisstuff\/stuff\/text\/filters\/stories_en2.xsl content.xml &gt; out.xml<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Remove the namespace from the opening html-tag, otherwise the python script will produce an empty document!<\/li>\n\n\n\n<li>Remove the string \/\/Fin?\/\/ at the bottom of the document. Keep the closing div!<\/li>\n\n\n\n<li>convert out.xml to story xml:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">~\/devel\/scripts\/toxml\/conv_with_q.py out.xml &gt; out2.xml<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>test out2.xml with xmllint. It should format properly:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">xmllint --format out2.xml<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check out2.xml for double quotes and fix them:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">python ~\/devel\/scripts\/toxml\/doubleqotes.py out2.xml &gt; out3.xml<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Finally, upload out2.xml<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>mkdir tmp 7z x ..\/the_story.odt xsltproc ~\/sisstuff\/stuff\/text\/filters\/stories_en2.xsl content.xml &gt; out.xml ~\/devel\/scripts\/toxml\/conv_with_q.py out.xml &gt; out2.xml xmllint &#8211;format out2.xml python ~\/devel\/scripts\/toxml\/doubleqotes.py out2.xml &gt; out3.xml<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[154],"tags":[161,159,160],"class_list":["post-669","post","type-post","status-publish","format-standard","hentry","category-sonstiges","tag-convert","tag-story","tag-xml"],"_links":{"self":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=669"}],"version-history":[{"count":5,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/669\/revisions"}],"predecessor-version":[{"id":828,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/669\/revisions\/828"}],"wp:attachment":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}