<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,37 +1,37 @@
 (class NSFileManager
-    
-    (- (id) directoryContentsAtPath:(id)path withPattern:(id)pattern is
+     
+     ;; Filters directory contents based on a provided regular expression.
+     (- (id) directoryContentsAtPath:(id)path withPattern:(id)pattern is
         ((self directoryContentsAtPath: path) select:
-            (do (directory)
-                (pattern findInString: directory))))
-    
+         (do (directory)
+             (pattern findInString: directory))))
+     
      ;; Forwards unknown methods to the singleton instance of NSFileManager.
      (+ handleUnknownMessage:(id)message withContext:(id)ctx is
         ((NSFileManager defaultManager) sendMessage:message withContext:ctx)))
 
 (class NSString
      
-     ;; Whitespace removal. Self-explanaory.
+     ;; Whitespace removal. Self-explanatory.
      (- (id) stripWhitespace is
-          (self stringByTrimmingCharactersInSet:(NSCharacterSet whitespaceCharacterSet)))
+        (self stringByTrimmingCharactersInSet:(NSCharacterSet whitespaceCharacterSet)))
      
      ;; Grabs the nth path component. There is no error checking on this. Be careful.
      (- (id) pathComponent:(int)index is
-          ((self pathComponents) index))
+        ((self pathComponents) index))
      
      ;; This makes string substitution much more concise and Rubyesque.
      ;; Merely an alias for replaceWithString:inString:
      (- (id) sub:(id)re with:(id)string is
-          (re replaceWithString:string inString:self))
+        (re replaceWithString:string inString:self))
      
      ;; This escapes all HTML characters. Perhaps this should be included in NuTemplate?
      (- (id) escapeHTML is
-          ((((self sub: /&amp;/  with: &quot;&amp;amp;&quot;)
-             sub: /\&quot;/ with: &quot;&amp;quot;&quot;)
-            sub: /&gt;/  with: &quot;&amp;gt;&quot;)
-           sub: /&lt;/  with: &quot;&amp;lt;&quot;)))
+        ((((self sub: /\&quot;/ with: &quot;&amp;quot;&quot;)
+          sub: /&gt;/  with: &quot;&amp;gt;&quot;)
+         sub: /&lt;/  with: &quot;&amp;lt;&quot;))))
 
 (class NSNull
      ;; Overriding stringValue prevents parentheses from appearing everywhere in my templates.
      ;; Kids, don't try this at home. I feel very dirty writing this.
-     (- (id) stringValue is &quot;&quot;)) 
\ No newline at end of file
+     (- (id) stringValue is &quot;&quot;))
\ No newline at end of file</diff>
      <filename>nu/extensions.nu</filename>
    </modified>
    <modified>
      <diff>@@ -10,4 +10,11 @@
         
 (global link-to-page
     (do (page)
-        &quot;&lt;a href=\&quot;#{(page path)}\&quot;&gt;#{(page path)}&lt;/a&gt;&quot;))
\ No newline at end of file
+        &quot;&lt;a href=\&quot;#{(page path)}\&quot;&gt;#{(page path)}&lt;/a&gt;&quot;))
+
+(global display-page
+    (do (page)
+        (if page
+            (NuMarkdown convert: (page contents))
+            (else
+                &quot;This page doesn't exist yet. Click on the 'Edit' link above to create it.&quot;))))
\ No newline at end of file</diff>
      <filename>nu/helpers.nu</filename>
    </modified>
    <modified>
      <diff>@@ -6,10 +6,7 @@
 Welcome to Nuki!
 
 Nuki is a simple Wiki engine powered by the Nunja web server, the Git version control system, and NuMarkdown.
-As you can _see_, Markdown works - however, &lt;em&gt;regular&lt;/em&gt; HTML is escaped.
-Links are created with Markdown syntax: [About Nuki](/AboutNuki).
-
-The logo above was drawn by the lovely and talented [Victoria Wang](http://violasong.com)
+As you can _see_, Markdown works.
 END)
         ($session commit))
           (unless ($session fileExists: &quot;About&quot;) </diff>
      <filename>nu/preload.nu</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,7 @@
 
 (load &quot;Nunja&quot;)
 (load &quot;NuMarkdown&quot;)
+(load &quot;SmartyPants&quot;)
 
 (load &quot;Nuki&quot;)
 (load &quot;Nuki:git&quot;)</diff>
      <filename>nukid</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@
 	&lt;div id=&quot;content&quot;&gt;
 		&lt;form action=&lt;%= &quot;/#{@path}/edit&quot; %&gt; method=&quot;post&quot;&gt;
 			&lt;label for=&quot;contents&quot;&gt;Page contents: &lt;/label&gt;
-			&lt;textarea name=&quot;contents&quot; rows=35 cols=75&gt;&lt;%= (@page filesystemContents) %&gt;&lt;/textarea&gt; &lt;br/&gt;
+			&lt;textarea name=&quot;contents&quot; rows=35 cols=75&gt;&lt;%= (@page contents) %&gt;&lt;/textarea&gt; &lt;br/&gt;
 			&lt;input type=&quot;submit&quot; value=&quot;Commit&quot;/&gt; &lt;br/&gt; &lt;input type=&quot;reset&quot;/&gt;
 		&lt;/form&gt;
 	&lt;/div&gt;</diff>
      <filename>site/edit.nhtml</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,8 @@
 	&lt;div id=&quot;content&quot;&gt;	
 		&lt;% (if @allRevisions %&gt;	
 		    &lt;% (@allRevisions each: (do (hash) %&gt;
-		        Revision: &lt;a href=&quot;/&lt;%= @path %&gt;/history/&lt;%= hash %&gt;&quot;&gt;&lt;%= hash %&gt;&lt;/a&gt; &lt;br&gt; &lt;% )) %&gt;
+		        Rev &lt;a href=&quot;/&lt;%= @path %&gt;/history/&lt;%= hash %&gt;&quot;&gt;&lt;%= hash %&gt;&lt;/a&gt;
+		 		(&lt;a href=&quot;/&lt;%= @path %&gt;/history/&lt;%= hash %&gt;/edit&quot;&gt;Edit&lt;/a&gt;)&lt;br&gt; &lt;% )) %&gt;
 		&lt;% (else %&gt;
 			Since the page &lt;%= @path %&gt; doesn't exist yet, it has no history.
 		&lt;% )) %&gt;</diff>
      <filename>site/history.nhtml</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,6 @@ background:#FFF;
 width: 750px;
 padding: 0;
 margin: 0;
-height: 100%;
 float: left;
 background:#FFF;
 }</diff>
      <filename>site/nuki.css</filename>
    </modified>
    <modified>
      <diff>@@ -15,11 +15,7 @@
 		&lt;/div&gt;
 	&lt;/div&gt;
 	&lt;div id=&quot;content&quot;&gt;
-	    &lt;% (if @page %&gt;
-	        &lt;%= (NuMarkdown convert: ((@page contents) escapeHTML)) %&gt;
-	        &lt;% (else %&gt;
-	            The page '&lt;%= @path %&gt;' doesn't exist yet. Click on the 'Edit' link above to create it. 				    		 
-	 			&lt;% )) %&gt; 
+	    &lt;%= (display-page @page) %&gt;
 	&lt;/div&gt;
 	&lt;div id=&quot;footer&quot;&gt;
 		&lt;p&gt;&amp;copy; 2007 &lt;a href=&quot;http://importantshock.wordpress.com&quot;&gt;Patrick Thomson&lt;/a&gt;. A &lt;a href=&quot;http://programming.nu&quot;&gt;Nu&amp;#8482;&lt;/a&gt; thing.&lt;/p&gt;</diff>
      <filename>site/page.nhtml</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,6 @@
 (get &quot;/pages&quot;
      (default-headers)
      (set @pages ($session allBlobs))
-     (p @pages)
      (eval (template-named &quot;listpages&quot;)))
 
 (get /\/(\w*)/
@@ -52,4 +51,12 @@
      (set @revision (TITLE pathComponent: 3))
      (set @page ($session fetchBlob: @path))
      (@page setContents: (@page contentsForRevisionHash: @revision))
-     (eval (template-named &quot;page&quot;)))
\ No newline at end of file
+     (eval (template-named &quot;page&quot;)))
+
+(get /\/(\w*)\/history\/(\w*)\/edit/
+     (default-headers)
+     (set @path (TITLE pathComponent: 1))
+     (set @revision (TITLE pathComponent: 3))
+     (set @page ($session fetchBlob: @path))
+     (@page setContents: (@page contentsForRevisionHash: @revision))
+     (eval (template-named &quot;edit&quot;)))
\ No newline at end of file</diff>
      <filename>site/site.nu</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>566e02472a5e2358221ba9ac36bb830aeef7c1f5</id>
    </parent>
  </parents>
  <author>
    <name>Patrick Thomson</name>
    <email>ironswallow@gmail.com</email>
  </author>
  <url>http://github.com/patrickt/nuki/commit/f6d5bed22bae4a5c53d5c42cbf2c1739694c0c0d</url>
  <id>f6d5bed22bae4a5c53d5c42cbf2c1739694c0c0d</id>
  <committed-date>2008-04-01T19:48:40-07:00</committed-date>
  <authored-date>2008-04-01T19:48:40-07:00</authored-date>
  <message>Many changes, the most significant of which is the support for editing a page starting at a given revision. Check the History pages to see it in action.

Improved the CSS a little bit. Removed the HTML escapes, as they weren't working right. (Thanks to Grayson Hansard for pointing that out.)

Changed the edit pages to use (page contents) rather than (page filesystemContents).</message>
  <tree>9c4fde20ec8e2a58ec8295fb441795c4b4f5b087</tree>
  <committer>
    <name>Patrick Thomson</name>
    <email>ironswallow@gmail.com</email>
  </committer>
</commit>
