{"id":669,"date":"2010-01-11T10:50:27","date_gmt":"2010-01-11T15:50:27","guid":{"rendered":"http:\/\/www.tigoe.net\/pcomp\/code\/?p=669"},"modified":"2012-01-08T06:03:35","modified_gmt":"2012-01-08T11:03:35","slug":"blog-housekeeping","status":"publish","type":"post","link":"https:\/\/www.tigoe.com\/pcomp\/code\/PHP\/669\/","title":{"rendered":"Blog Housekeeping"},"content":{"rendered":"<p>I&#8217;m making some changes to this blog.  I&#8217;ve been unhappy about the fact that all the code is static, not the code I use every day. Instead, I want a nice code repository, so whatever I write on my machine can be published directly, and if I update it, the updates end up here. I would also like syntactical highlighting of the code. And now, ta dah!  It&#8217;s all done.  Here&#8217;s what I did, for your reference and my own, because I&#8217;ll forget next time I need to update it.<\/p>\n<p>So from now on, new code on this blog will look like this:<\/p>\n<pre class=\"brush: arduino\">\r\n[include file=\"..\/..\/code\/Arduino\/helloTom\/helloTom.pde\" start=\"3\" clean=\"true\"]\r\n<\/pre>\n<p>And it&#8217;ll all be updated whenever I make changes. \u00a0Exciting, isn&#8217;t it?<\/p>\n<p><!--more--><\/p>\n<p>First, I set up a <a href=\"http:\/\/www.webdav.org\/\">webDAV<\/a> directory that&#8217;s linked to my code directory on my laptop. I&#8217;ll be switching to git soon, as I have a good bit of code on gitHub now.<\/p>\n<p>The WordPress plugin <a href=\"http:\/\/www.amberpanther.com\/contributions\/wp-include-file\/\">WP include-file<\/a> does a nice job of pulling in remote files. \u00a0It doesn&#8217;t do anything to make sure the included code is HTML-safe, though, so I made a slight change to it. \u00a0Line 88 looks like this now:<\/p>\n<pre class=\"brush:php; light:true\">\t\r\n$content = htmlentities(ob_get_clean());\r\n<\/pre>\n<p>The htmlentities() call cleans up things like the pointy brackets on some code includes, for example.  Handy.<\/p>\n<p>For code coloring, I use <a href=\"http:\/\/www.viper007bond.com\/wordpress-plugins\/syntaxhighlighter\/\">Syntax Highlighter Evolved<\/a>, which is a wrapper around the javascript <a href=\"http:\/\/alexgorbatchev.com\/wiki\/SyntaxHighlighter\">Syntax Highlighter<\/a>. It has syntax coloring for a lot of languages, but not for Arduino or Processing, but Alex has a good post explaining <a href=\"http:\/\/www.viper007bond.com\/wordpress-plugins\/syntaxhighlighter\/adding-a-new-brush-language\/\">how to add new brushes<\/a>.  Fortunately, Sebastian Korczak wrote an <a href=\"http:\/\/en.myinventions.pl\/index.php?page=ProcessingSyntaxHighlighting\">extension brush for Syntax Highlighter for Processing<\/a>.  Theres also an <a href=\"http:\/\/elabz.com\/arduino-syntaxhighlighter\/\"Arduino Brush available<\/a><\/a><\/p>\n<p>That&#8217;s it, really.  Hope it helps. I expect it&#8217;ll help me, at least.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m making some changes to this blog. I&#8217;ve been unhappy about the fact that all the code is static, not the code I use every day. Instead, I want a nice code repository, so whatever I write on my machine can be published directly, and if I update it, the updates end up here. I &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.tigoe.com\/pcomp\/code\/PHP\/669\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Blog Housekeeping&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,3,7],"tags":[86,87,88],"class_list":["post-669","post","type-post","status-publish","format-standard","hentry","category-arduinowiring","category-PHP","category-Processing","tag-code-repositories","tag-scm","tag-syntax-highlighting"],"_links":{"self":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/comments?post=669"}],"version-history":[{"count":143,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/669\/revisions"}],"predecessor-version":[{"id":1037,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/669\/revisions\/1037"}],"wp:attachment":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/media?parent=669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/categories?post=669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/tags?post=669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}