Markdown-discuss Digest, Vol 5, Issue 11
Jacob Patton
shotwise at yahoo.com
Fri Mar 19 15:50:12 EST 2004
John,
I've finally had a chance to implement the code you
suggested. Barring one small change, it works like a
charm--thank you for a great set of scripts! (And to
think I had forgotten about SmartyPants!)
The change I had to make required adding "perl" before
the command to be executed.
For example:
return shell_exec("echo $input | $markdown_script");
becomes
return shell_exec("echo $input | perl
$markdown_script");
Thanks again,
J.P.
> Date: Tue, 16 Mar 2004 11:51:24 -0500
> From: John Gruber <gruber at fedora.net>
> Subject: Re: Markdown & PHP
>
> I wrote a simple PHP wrapper for Markdown, which I
> named "PHP_MarkdownWrapper.php.inc". Here's the
> entire code:
>
> <?php
>
> include("markdown.config.inc");
>
> function convert_markdown ($input) {
> global $markdown_script;
> $input = escapeshellarg($input);
> return shell_exec("echo $input |
> $markdown_script");
> }
>
> function convert_smartypants ($input) {
> global $smartypants_script;
> $input = escapeshellarg($input);
> return shell_exec("echo $input |
> $smartypants_script");
> }
>
> function get_markdown_version () {
> global $markdown_script;
> return shell_exec("$markdown_script
> --shortversion");
> }
>
> function get_smartypants_version () {
> global $smartypants_script;
> return shell_exec("$smartypants_script
> --shortversion");
> }
>
> ?>
__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
More information about the Markdown-discuss
mailing list