Documents Directory

This directory contains some writings. They are written in Markdown and are rendered to HTML using a slightly modified version of Markdown.pl by Daring Fireball.

218,220c218,230
<           $text = <>;
<       }
<         print Markdown($text);
---
>           open my $fh, '<', $ENV{'DOCUMENT_ROOT'} . $ENV{'DOCUMENT_URI'} or do {
>               print "Status: 500 Internal Server Error\nContent-Type: text/plain\n\nCouldn't open file";
>               die "Couldn't open file";
>           };
>           $text = <$fh>;
>       }   
>       if ($ENV{'QUERY_STRING'} eq 'src=1') {
>           print "Status: 200 OK\nContent-Type: text/plain; charset=utf-8\n\n";
>           print $text;
>       } else {
>           print "Status: 200 OK\nContent-Type: text/html; charset=utf-8\n\n<!DOCTYPE html>";
>           print Markdown($text);
>       }

This patch allows Markdown to run as a CGI program. It also allows the user to add src=1 as a parameter to view the file as unprocessed Markdown.