+2012-09-18 Justin J. Novack <jnovack@gmail.com>
+
+ * Add Markdown as a known file-type.
+
2012-09-16 Christian Weiske <cweiske@cweiske.de>
* Implement request #12: DOAP documents for all pastes
$ 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.
'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',
--- /dev/null
+<?php
+namespace phorkie;
+
+class Renderer_Markdown
+{
+ /**
+ * Converts the code to HTML
+ *
+ * @param File $file File to render
+ * @param Tool_Result $res Tool result to integrate
+ *
+ * @return string HTML
+ */
+ public function toHtml(File $file, Tool_Result $res = null)
+ {
+ /**
+ */
+ require_once 'markdown.php';
+ $markdown = \markdown($file->getContent());
+
+ return '<div class="markdown">'
+ . $markdown
+ . '</div>';
+ }
+}
+
+?>