Markdown Viewer for PHP

So since starting my new job, I’ve had to use Github more than just for downloading cool code but engaging in it more as apart of project management. I’ve grown to really like the site; it does the job of versioning very well minus the headache that subversion is – seriously WordPress, get on this!

One thing annoyed me a bit and that is the Markdown documentation; don’t get me wrong, Markdown is pretty cool, but I didn’t have an easy way to make sure it’s formatted properly and thus caused me to upload multiple revisions of my files. So a quick search on the interwebs found me on this handy little script: PHP Markdown by Michel Fortin.

This script takes on the rules set out in John Gruber’s orignal Markdown project and puts a PHP processor on it allowing PHP devs to use Markdown in their projects.

It’s pretty cool, but I wanted something that allowed me to view what the hell I was doing quickly, so I quickly made a wrapper for the PHP script that allows a Markdown writer to see what the hell they are doing. And thus, Markdown Viewer for PHP is it!

Get Markdown Viewer for PHP on Github
git clone https://[email protected]/WolfieZero/Markdown-Viewer-PHP.git

Hopefully it’s pretty simple to use. Just place the files into a directory on your local or remote server, access it via the URL you assigned that location to and then add ?src=LOCATION/FILE to the end of that URL to begin using it. So in my environment I set it up locally using the host name markdown.view and thus can access any file on my local machine by going http://markdown.view/?src=/Sites/this/project/ and it will output the formatting given in the file.

The only issue I believe may happen is trying to access local files where the Markdown Viewer is on a remote machine; I haven’t tested that yet, but I’m 99.9% sure it won’t work.

I know there are other options out there that allow you to do pretty much the same thing and probably better, but they either cost money, don’t work on your system or you don’t use that particular tool set. Hopefully, PHP is something that everybody should be able to use on their machine so, for me, it’s pretty universal.

Let me know what you think of it and if you have any suggestion then please let me know in the comments!