<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,7 @@
 
 require 'rubygems'
 require 'maruku'
+require 'atom/entry'
 
 require 'yaml'
 
@@ -13,6 +14,13 @@ def write_default_config_file
     f.write &lt;&lt;END
 # directory to save output files to
 output directory: ./output/
+
+# system-wide author details - please fill in at least the name.
+# (you can also give per-entry author names with the Author attribute)
+#author:
+#  name: The Author
+#  uri: http://example.org/
+#  email: author@example.org
 END
   end
 end
@@ -25,6 +33,34 @@ def load_config
   YAML.load(File.read(CONF_FILE))
 end
 
+require 'rexml/xpath'
+
+# takes a Maruku document, turns it into an Atom::Entry
+def maruku_to_atom(mrk)
+  e = Atom::Entry.new
+
+  e.tag_with mrk.attributes[:tags]
+  e.title     = mrk.attributes[:title]
+  e.updated   = mrk.attributes[:updated]
+
+  if mrk.attributes[:author]
+    e.authors.new :name =&gt; mrk.attributes[:author]
+  end
+
+  e.content = ''
+  e.content.type = 'xhtml'
+
+  tree = mrk.to_html_document_tree
+
+  # skip the &lt;h1/&gt; (it's already in the &lt;atom:title/&gt;)
+  REXML::XPath.each(tree, '//body/*[name() != &quot;h1&quot;]') do |el|
+    # unfortunately I didn't expose an atom-tools API for appending elements...
+    e.content.instance_variable_get('@content') &lt;&lt; el
+  end
+
+  e
+end
+
 def write_output
   outdir = Conf['output directory']
 
@@ -33,13 +69,17 @@ def write_output
   end
 
   Dir[ENTRIES_DIR + '/*'].each do |entry|
-    doc = Maruku.new(File.read(entry))
+    mrk = Maruku.new(File.read(entry))
+    mrk.attributes[:updated] = File.mtime(entry)
+
+    bname = File.basename(entry)
 
-    outname = (File.basename(entry) + '.html')
-    outpath = File.join Conf['output directory'], outname
+    File.open(File.join(outdir + bname + '.html'), 'w') do |f|
+      f.write mrk.to_html_document
+    end
 
-    File.open(outpath, 'w') do |f|
-      f.write doc.to_html_document
+    File.open(File.join(outdir + bname + '.atom'), 'w') do |f|
+      f.write maruku_to_atom(mrk).to_s
     end
   end
 end</diff>
      <filename>bin/process-maruku.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,8 @@
+## Requirements ##
+
+- Maruku
+- atom-tools
+
 ## HOWTO ##
 
 Entries go in /entries. They are formatted using Markdown ([Maruku][]'s</diff>
      <filename>doc/README</filename>
    </modified>
    <modified>
      <diff>@@ -3,3 +3,9 @@ Tags: sample test
 # Sample Entry #
 
 This is a sample entry. Feel free to delete it.
+
+All entries are processed using [Maruku][], an enhanced version of
+[Markdown][].
+
+[Maruku]: http://maruku.rubyforge.org/
+[Markdown]: http://daringfireball.net/projects/markdown/</diff>
      <filename>entries/sample</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b8a25963f77e5732a278b33640f3cc36d7a6832a</id>
    </parent>
  </parents>
  <author>
    <name>bct</name>
    <email>bct@nyarlathotep.(none)</email>
  </author>
  <url>http://github.com/bct/sloth-log/commit/70a3d8441cd92ed903311a239bf4feb470a75536</url>
  <id>70a3d8441cd92ed903311a239bf4feb470a75536</id>
  <committed-date>2009-04-26T00:54:49-07:00</committed-date>
  <authored-date>2009-04-26T00:54:49-07:00</authored-date>
  <message>maruku -&gt; atom</message>
  <tree>e4aa12d570cd00f7d6f7c8a29c857ddd875ead5c</tree>
  <committer>
    <name>bct</name>
    <email>bct@nyarlathotep.(none)</email>
  </committer>
</commit>
