<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Html on Lorenzo Bolla</title><link>https://lbolla.info/tags/html/</link><description>Recent content in Html on Lorenzo Bolla</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 30 Jan 2009 00:00:00 +0000</lastBuildDate><atom:link href="https://lbolla.info/tags/html/index.xml" rel="self" type="application/rss+xml"/><item><title>Command line HTML validator</title><link>https://lbolla.info/blog/command-line-html-validator/</link><pubDate>Fri, 30 Jan 2009 00:00:00 +0000</pubDate><guid>https://lbolla.info/blog/command-line-html-validator/</guid><description>&lt;p&gt;Valid HTML is something we should strive to achieve. &lt;a href="http://validator.w3.org/"&gt;W3C Validator&lt;/a&gt; is an invaluable tool to do just that. Unfortunately, validating a local file you are working on can be annoying after the 100th time you've uploaded it to the &lt;a href="http://validator.w3.org/"&gt;W3C website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://raw.github.com/lbolla/junk/master/utils/w3c_validate.py"&gt;Here&lt;/a&gt; you can find a &lt;a href="https://raw.github.com/lbolla/junk/master/utils/w3c_validate.py"&gt;command line HTML validator&lt;/a&gt; that simply uploads anything passed to it from &lt;code&gt;stdin&lt;/code&gt; to the &lt;a href="http://validator.w3.org/"&gt;W3C Validator&lt;/a&gt;. The basic syntax is:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$&amp;gt; python validate.py &amp;lt; file_to_validate.html
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It requires &lt;a href="http://www.aaronsw.com/2002/html2text/"&gt;html2text&lt;/a&gt; to print the detailed list of errors.&lt;/p&gt;</description></item></channel></rss>