{"id":840,"date":"2025-12-30T08:36:41","date_gmt":"2025-12-30T07:36:41","guid":{"rendered":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=840"},"modified":"2025-12-30T08:36:41","modified_gmt":"2025-12-30T07:36:41","slug":"formatting-a-story","status":"publish","type":"post","link":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=840","title":{"rendered":"Formatting a story"},"content":{"rendered":"\n<p>Since I accidentally deleted the LibreOffice-Macro for fixing the character and paragraph styles, I tackled the problem by parsing the ODT-XML directly. To do so, just unpack story.odt to a separate directory and then run:<\/p>\n\n\n\n<p><code>python ~\/sisstuff\/stuff\/text\/filters\/content_xml.py content.xml<\/code><\/p>\n\n\n\n<p>The script converts ODT-XML to FM-XML and handles the following cases:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Descriptive paragraphs<\/li>\n\n\n\n<li>Quoted text<\/li>\n\n\n\n<li>Lisps<\/li>\n\n\n\n<li>Gurgle<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Update a story with SQL<\/h2>\n\n\n\n<p>To update a story without deleting and uploading it again, upload the XML-File to the server, find the ID of the story and issue the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fm=# \\set c `cat \/tmp\/fm.xml`\nfm=# update mystories_mystory set the_story = :'c' where id = &lt;id>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Since I accidentally deleted the LibreOffice-Macro for fixing the character and paragraph styles, I tackled the problem by parsing the ODT-XML directly. To do so, just unpack story.odt to a separate directory and then run: python ~\/sisstuff\/stuff\/text\/filters\/content_xml.py content.xml The script converts ODT-XML to FM-XML and handles the following cases: Update a story with SQL To &hellip; <a href=\"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=840\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Formatting a story<\/span><\/a><\/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":[159],"class_list":["post-840","post","type-post","status-publish","format-standard","hentry","category-sonstiges","tag-story"],"_links":{"self":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/840","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=840"}],"version-history":[{"count":1,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/840\/revisions"}],"predecessor-version":[{"id":841,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/840\/revisions\/841"}],"wp:attachment":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}