{"id":4946,"date":"2010-09-25T21:57:17","date_gmt":"2010-09-25T19:57:17","guid":{"rendered":"http:\/\/www.chipwreck.de\/blog\/?p=4946"},"modified":"2016-12-31T02:24:55","modified_gmt":"2016-12-31T01:24:55","slug":"installing-a-current-version-of-htmltidy","status":"publish","type":"post","link":"https:\/\/www.chipwreck.de\/blog\/2010\/09\/25\/installing-a-current-version-of-htmltidy\/","title":{"rendered":"Installing a current version of HTMLTidy"},"content":{"rendered":"<p>HTMLTidy is an open source utility for tidying up HTML. It is a command-line utility which is included in OS X. It is also used in my <a href=\"\/blog\/software\/coda-php\/\">Plug-in for Coda<\/a>. But Apple decided to include a quite old version (from 2006) &#8211; even in the current OS X 10.6 (Snow Leopard).<!--more--><\/p>\n<p>Since HTMLTidy has got some quite useful new features in the latest versions (like &#8220;<kbd>preserve-entities<\/kbd>&#8220;) and some bugfixes, this post explains how to install an updated version of HTMLTidy and how to use this with the Coda plug-in.<\/p>\n<p>There are three different ways to accomplish this: You can try the binary I included here for download or use MacPorts or you can update by compiling your own version:<\/p>\n<h4>Method 1 &#8211; Downloading the binary (Use only if you&#8217;re afraid of the Terminal)<\/h4>\n<ol>\n<li>Download this <a href=\"\/downloads\/tidy-osx.zip\">zip file &raquo;<\/a> and unpack it.<\/li>\n<li>Copy the extracted file to your &#8220;Applications&#8221;-folder *<\/li>\n<li>Now the new version can be found in <kbd>\/Applications\/tidy<\/kbd><\/li>\n<\/ol>\n<p class=\"small\">Of course &#8220;\/Applications&#8221; is not a very good location for a command line utility, but this is only for people who do not want to use the Terminal..<\/p>\n<h4>Method 2 &#8211; Using MacPorts<\/h4>\n<p>If you already use MacPorts that&#8217;s the most easy solution.<\/p>\n<p>Open the terminal and enter this<\/p>\n<p><code>sudo port install tidy<\/code><\/p>\n<p>After MacPorts has downloaded and compiled the current version, you can find it in <kbd>\/opt\/local\/bin\/tidy<\/kbd>. (If you haven&#8217;t set up MacPorts to use another path)<\/p>\n<h4>Method 3 &#8211; Compiling a new version<\/h4>\n<p>If you know how to use the Terminal and navigate there, try this (in the Terminal):<\/p>\n<pre>\r\ncd \/tmp\r\ncvs -d:pserver:anonymous@tidy.cvs.sourceforge.net:\/cvsroot\/tidy login\r\n<\/pre>\n<p class=\"terminal\">Now you are asked for a password: Simply press return<\/p>\n<pre>\r\ncvs -z3 -d:pserver:anonymous@tidy.cvs.sourceforge.net:\/cvsroot\/tidy co -P tidy\r\ncd tidy\/\r\nsh .\/build\/gnuauto\/setup.sh\r\n.\/configure --prefix=\/usr\/local\/\r\nmake\r\nsudo make install\r\n<\/pre>\n<p class=\"terminal\">Here you&#8217;ve got to enter your OS X password once.<\/p>\n<p>Now the updated version can be found in <kbd>\/usr\/local\/bin\/tidy<\/kbd><\/p>\n<h4>Configuring the Coda Plugin<\/h4>\n<p>Depending on which of the three methods you used, the new location for tidy is <kbd>\/Applications\/tidy<\/kbd> or <kbd>\/opt\/local\/bin\/tidy<\/kbd> or <kbd>\/usr\/local\/bin\/tidy<\/kbd>.<\/p>\n<p>Now in Coda open &#8220;Plug-ins&#8221; ->&#8221;PHP &#038; Web Toolkit&#8221; -> &#8220;Preferences&#8221; and copy this location to the field &#8220;Tidy binary&#8221;. That&#8217;s it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTMLTidy is an open source utility for tidying up HTML. It is a command-line utility which is included in OS X. It is also used in my Plug-in for Coda. But Apple decided to include a quite old version (from 2006) &#8211; even in the current OS X 10.6 (Snow Leopard).<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,4],"tags":[78],"class_list":["post-4946","post","type-post","status-publish","format-standard","hentry","category-coda","category-osx","tag-osx"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paPEN-1hM","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/posts\/4946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/comments?post=4946"}],"version-history":[{"count":0,"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/posts\/4946\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/media?parent=4946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/categories?post=4946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chipwreck.de\/blog\/wp-json\/wp\/v2\/tags?post=4946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}