From: Justin J. Novack Date: Tue, 18 Sep 2012 19:25:47 +0000 (-0400) Subject: Feature: Add Markdown parsing X-Git-Tag: v0.3.0~41^2 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/d316adab970b993504ba38736a0f8753ef4bb052?ds=sidebyside Feature: Add Markdown parsing --- diff --git a/ChangeLog b/ChangeLog index afefa9a..8557be7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-09-18 Justin J. Novack + + * Add Markdown as a known file-type. + 2012-09-16 Christian Weiske * Implement request #12: DOAP documents for all pastes diff --git a/README.rst b/README.rst index d1c6491..4a157bf 100644 --- a/README.rst +++ b/README.rst @@ -84,6 +84,9 @@ phorkie stands on the shoulders of giants. $ pear channel-discover zustellzentrum.cweiske.de $ pear install zz/mime_type_plaindetect-alpha + $ pear channel-discover pear.michelf.ca + $ pear install michelf/Markdown + Note that this version of GeSHi is a bit outdated, but it's the fastest way to install it. diff --git a/data/config.default.php b/data/config.default.php index 88c9ae5..3fc48f6 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -57,6 +57,11 @@ $GLOBALS['phorkie']['languages'] = array( 'mime' => 'application/javascript', 'geshi' => 'javascript' ), + 'md' => array( + 'title' => 'Markdown', + 'mime' => 'text/x-markdown', + 'renderer' => '\\phorkie\\Renderer_Markdown' + ), 'pl' => array( 'title' => 'Perl', 'mime' => 'application/x-perl', diff --git a/src/phorkie/Renderer/Markdown.php b/src/phorkie/Renderer/Markdown.php new file mode 100644 index 0000000..628d87f --- /dev/null +++ b/src/phorkie/Renderer/Markdown.php @@ -0,0 +1,27 @@ +getContent()); + + return '
' + . $markdown + . '
'; + } +} + +?>