The Hobbit Hole

In a hole there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.

4/26/2007

reST to WordML

Filed under: Programming — bilbo @ 7:23 pm

I’ve blogged about how much I like reStructuredText in the past. One of the problems with it though is getting PDF output; it’s unwieldy and not accurate. The reST->LaTeX->PDF pipeline is not very friendly and there are problems with the figure alignment in the resulting PDF.

Microsoft Word can produce very nice PDFs. Unfortunately, it’s not easy (read: nigh upon impossible) to intermingle code and text within a Word document (for example, literate programming), something that reST was designed to do.

Hm, if reST and MS Word were chocolate and peanut butter… :) Well, as it happens to be, Microsoft had the foresight in Office 2003 to create an XML format for each of their Office applications, including MS Word. The reST tools are written to output a node based hierarchy, which lends itself to HTML and XML output. Sounds like chocolate and peanut butter to me. :)

To this end, I’ve started a simple reST writer for WordML. It’s very basic and only does maybe 1/10-1/5 of the features in reST, but it is a start. Couple this with a good PDF printer driver for Word, and it’s easy to make (accurate) PDFs. As a bonus, the Word Viewer can load these XML files and print them, meaning you don’t even need MS Word to be installed (though you’re stuck with the styles in the template file.)

Edit: I’ve added footnotes and images. Footnotes are implemented as endnotes, to simulate the HTML output more closely. Images are their own paragraph, usually centered. Also, their size is not determined, so you have to supply it.

Edit: Enumerated lists are fully implemented now. I use lists a lot, so this goes a long way to getting my own writing projects started.

Cow Farts, Global Warming, and You

Filed under: General — bilbo @ 3:43 pm

Sometimes truth really is stranger than fiction.

I routinely read the “Ask Yahoo” blog for the weird questions.  More often than not, the answers put some sanity on what are otherwise strange queries.

One of my favorites so far… “Are cow farts really that bad for the environment?”

Go ahead…read it.  You know you want to.  I’ll wait.

Did you come back here, mouth agape?  That’s right: 18%.

All your carpooling and mass transit aren’t doing nearly what you thought to eliminate global warming.  Instead, you should stop drinking milk and eating hamburgers.  I’m sure McDonald’s isn’t worried about it.

4/25/2007

Microsoft to roll out dynamic language layer for .NET

Filed under: Programming — bilbo @ 9:32 am

Mary Jo Foley writes about a new library for .NET that will allow integration of dynamic languages into the CLR much more easily. “Oh frabjous joy! Callooh! Callay!” was voiced by compiler writers everywhere.

For myself and Scheme in particular, will some sort of stack inspection be included to allow for things such as continuations? Enquiring minds want to know! Based on the few comments about Ruby, I would think so, as Ruby supports full continuations, I believe.