summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/ballet.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/ballet.pm b/lib/ballet.pm
index aa2836b..d48a3b7 100644
--- a/lib/ballet.pm
+++ b/lib/ballet.pm
@@ -3,14 +3,21 @@ package ballet;
 use 5.010;
 
 use Dancer ':syntax';
+
 use ballet::Git;
 
 our $VERSION = '0.1';
 
 my $git = ballet::Git->new( wiki_path => setting('wiki_path') );
 
-get '/' => sub {
-    wiki_page('Home');
+get '/' => sub { wiki_page('Home'); };
+
+get '/history/*' => sub {
+    my ($page_name) = splat;
+
+    debug("looking history for $page_name");
+
+    my $history = $git->find_history($page_name, 'master');
 };
 
 get '/edit/*' => sub {
@@ -22,6 +29,14 @@ get '/edit/*' => sub {
     template 'edit', {content => $content, title => 'Home'};
 };
 
+get '/*' => sub {
+    my ($page_name) = splat;
+
+    debug("looking for page $page_name");
+
+    wiki_page($page_name);
+};
+
 post '/edit/*' => sub {
     my ($page_name) = splat;
 
@@ -32,7 +47,9 @@ post '/edit/*' => sub {
 
 sub wiki_page {
     my $page_name = shift;
+
     my $content = $git->find_page( $page_name, 'master' );
+    $content = $git->convert('textile', $content);
 
     template 'page',
       {