git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2678 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
24 lines
534 B
PHP
Executable File
24 lines
534 B
PHP
Executable File
#!/usr/bin/php
|
|
<?php
|
|
|
|
require_once ("domframework/markdown.php");
|
|
|
|
if (! isset ($argv[1]))
|
|
{
|
|
file_put_contents ("php://stderr", "No file to convert in markdown provided\n");
|
|
exit (1);
|
|
}
|
|
if (! file_exists ($argv[1]))
|
|
{
|
|
file_put_contents ("php://stderr", "The file to convert in markdown doesn't exists\n");
|
|
exit (2);
|
|
}
|
|
if (! is_readable ($argv[1]))
|
|
{
|
|
file_put_contents ("php://stderr", "The file to convert in markdown is not readable\n");
|
|
exit (3);
|
|
}
|
|
|
|
$md = new markdown ();
|
|
echo $md->html (file_get_contents ($argv[1]));
|