Markdown.cgi v1.3: Fixing the Markdown Source
Whoops! I wrote Markdown.cgi so I could easily preview Markdown content in BBEdit, but 1.2 broke this. As a fix, instead of using .markdown for source and .text to see the HTML output, v1.3 goes back to using .text files, and now ?markdown appended to the URL returns the Markdown source.
I considered allowing additional query arguments, but Apple’s sh and expr string matching is quite limited, and I don’t want to make the whole thing any slower or more complicated than necessary. Fortunately, it would be easy to change the ‘magic’ query string. Just change the 'markdown' literal on line 7.
I also moved the downloadable (.txt) script, to make the older versions available, and so I can avoid pointing people to old versions.

fluxkompensator said,
June 2, 2008 at 4:23 pm
I have just tried this thingy and it works out of the box on a Apache 2. Thanks for upping this and thanks for the idea …
To make it a bit more realistic you should insert (in the head section) a description and keywords. I would like to do it by myself, but i have no idea what this line
TITLE=
head -1 $PATH_TRANSLATED | cut -f2means. Maybe you can translate this and i do the rest?
-Andre
reppep said,
June 2, 2008 at 8:23 pm
Andre,
“
head -1” extracts the first line of the file, and “cut -f2” extracts the second column (after oneTab, up to the second). If present, this is the title.If I ever revised it, I’ll try to remember to explain more, but you can figure this out with “
man head cut” at a command line.