Hairy Sun

Matt's Blog on Some Geeky Topics

KindleGen Fun

Can someone please tell me why kindlegen can’t handle <pre>?

I have some html:

1
2
3
<pre class="literal-block">
$ python hello.py
</pre>

And kindlegen kindly gives me this?

1
2
3
4
5
6
7
<blockquote>
  <div align="left">
    <tt>
      <br/>$ python hello.py<br/>
    </blockquote>
  </tt>
</div>

Calibre on the other hand seems a little more pleasant::

1
2
3
4
5
<blockquote height="1em" width="0pt">
  <tt>
    <br></br>$ python hello.py<br></br>
  </tt>
</blockquote>

I thought well formed XML was a solved problem. The internet abounds with people claiming that one should only use kindlegen. The hacker in me sees a new rst translater, the realist in me cringes.

Comments