title: Export syntax highlighting as html
body: <p>VSCode does a nice job at syntax highlighting.  I'd like to include some of that nice colored text in a webpage.  Is there a way to export/render/save as an html file with html tags/css syntax highlighting?</p>
  <p>Example Input:</p>
  <pre class="lang-py prettyprint-override"><code>if __name__ == '__main__':
      print(&quot;Hello&quot;)
  
  </code></pre>
  <p>Desired Output:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;/.../hello.py.html&lt;/title&gt;
  &lt;meta name=&quot;Generator&quot; content=&quot;Vim/7.1&quot;&gt;
  &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
  &lt;/head&gt;
  &lt;body bgcolor=&quot;#ffffff&quot; text=&quot;#000000&quot;&gt;&lt;font face=&quot;monospace&quot;&gt;
  &lt;font color=&quot;#a52a2a&quot;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;__name__ == '&lt;font color=&quot;#ff00ff&quot;&gt;__main__&lt;/font&gt;':&lt;br&gt;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#a52a2a&quot;&gt;&lt;b&gt;print&lt;/b&gt;&lt;/font&gt;(&amp;quot;&lt;font color=&quot;#ff00ff&quot;&gt;Hello&lt;/font&gt;&amp;quot;)&lt;br&gt;
  &lt;br&gt;
  &lt;/font&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>