A few years ago Six Apart's Anil Dash posted this article about using Movable Type to generate a Word document of your blog or part of it. It uses WordML to generate a Microsoft Word 2003 formatted documents. This is fine and dandy if you have Word, but what if you don't?
As Anil's post shows, it is very easy for Movable Type to generate any document type that you know the specification, so lets give it a go with another ubiquitous file format; Rich Text Format, the full specification can be downloaded from Microsoft
Below is a simple template which outputs a Rich Text Formatted file showing the last 5 entries from your blog.
{\rtf
{\b <MTBlogName>}
\par
<MTEntries lastn="1">
Author: <MTEntryAuthorNickname encode_xml="1">
\par
Modified: <MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ">
\par
</MTEntries>
\par
\par
<MTEntries lastn="5">
{\b <MTEntryTitle>}
\par
<MTEntryBody convert_breaks="0" remove_html="1">
\par
\par
</MTEntries>
}
you need to create a new custom index template and paste the above code in. Set the output file to recent.rtf. When this template is published it generates a rich text format file at your blog root that contains the last 5 entries in your blog.
This technique can be used for a number of different formats; OOXML, LaTex or OpenDocument for example. It can also be expanded to include a list of recent comments or limit the report to specific tags, categories or keywords.
Leave a comment