static generator
[mdref/mdref] / mdref / Action.php
index dcd8fcbed025d24f4725c9b9c0976a2c19d8e2ba..3e318be34d4d45af301d5da2309fa35adcea7d90 100644 (file)
@@ -36,20 +36,8 @@ class Action extends Observer {
                $pld = new \stdClass;
                
                try {
-                       $pld->quick = function($string) {
-                               $md = \MarkdownDocument::createFromString($string);
-                               $md->compile(\MarkdownDocument::AUTOLINK);
-                               return $md->getHtml();
-                       };
-                       
-                       $pld->file = function($file) {
-                               $fd = fopen($file, "r");
-                               $md = \MarkdownDocument::createFromStream($fd);
-                               $md->compile(\MarkdownDocument::AUTOLINK | \MarkdownDocument::TOC);
-                               $html = $md->getHtml();
-                               fclose($fd);
-                               return $html;
-                       };
+                       $pld->quick = [$this->reference, "formatString"];
+                       $pld->file = [$this->reference, "formatFile"];
                        
                        $pld->ref = implode("/",  $this->baseUrl->params(
                                $this->baseUrl->mod($ctl->getRequest()->getRequestUrl())));