{"id":123,"date":"2005-03-09T15:44:08","date_gmt":"2005-03-09T13:44:08","guid":{"rendered":"http:\/\/blogs.bl0rg.net\/netzstaub\/?p=123"},"modified":"2005-03-09T15:44:08","modified_gmt":"2005-03-09T13:44:08","slug":"ecto","status":"publish","type":"post","link":"https:\/\/blogs.bl0rg.net\/netzstaub\/2005\/03\/09\/ecto\/","title":{"rendered":"ecto"},"content":{"rendered":"<p>Ecto somehow managed to fuck up all the fixed-width text used for program code in the LISP entries. This will get fixed ASAP, sorry.<\/p>\n<p><strong>Update<\/strong>: it should be better now :). Here is the LISP sourcecode I used to cleanup the entries. I replace P entries with monospace font with PRE entries. This sourcecode uses the HTML pattern matcher which can be found at svn:\/\/bknr.net\/trunk\/bknr\/src\/html-match . It is a real memory abuser, and quite slow too, but it works \ud83d\ude42<\/p>\n<pre>(defun load-file (file)\n  (with-open-file (s file :direction :input)\n    (let ((lines (loop for line = (read-line s nil 'eof)\n                    until (eql line 'eof)\n                    collect line)))\n      (reduce #'(lambda (s1 s2) (concatenate 'string s1 s2)) lines :initial-value \"\"))))\n\n(defun cleanup-ecto (file output-file)\n  (let* ((body (cons :html\n                    (net.html.parser:parse-html (load-file file))))\n         (res (html-replace body\n               (html-pattern ((:p :style \"font-family:monospace;font-size:13pt;\") ?body)\n                             (cons :pre\n                                   (html-replace ?body\n                                                 (html-pattern :br (string #\\Newline))))))))\n    (with-open-file (s output-file :direction :output :if-exists :supersede)\n      (net.html.generator:html-stream s\n          (mapcar #'(lambda (x) (net.html.generator:html-print x s))\n                  (cdr res))))))\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ecto somehow managed to fuck up all the fixed-width text used for program code in the LISP entries. This will get fixed ASAP, sorry. Update: it should be better now :). Here is the LISP sourcecode I used to cleanup &hellip; <a href=\"https:\/\/blogs.bl0rg.net\/netzstaub\/2005\/03\/09\/ecto\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,3],"tags":[],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry","category-english","category-lispstaub"],"_links":{"self":[{"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":0,"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.bl0rg.net\/netzstaub\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}