move formatting from JS to PHP
[mdref/mdref] / mdref / Formatter / Discount.php
diff --git a/mdref/Formatter/Discount.php b/mdref/Formatter/Discount.php
deleted file mode 100644 (file)
index c787c7a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-namespace mdref\Formatter;
-
-use mdref\Exception;
-use mdref\Formatter;
-
-use MarkdownDocument;
-
-class Discount extends Formatter {
-
-       function formatString(string $string) : string {
-               $md = \MarkdownDocument::createFromString($string);
-               $md->compile(\MarkdownDocument::AUTOLINK);
-               return $md->getHtml();
-       }
-
-       function formatFile(string $file) : string {
-               $fd = fopen($file, "r");
-               if (!$fd) {
-                       throw Exception::fromLastError();
-               }
-
-               $md = \MarkdownDocument::createFromStream($fd);
-               $md->compile(\MarkdownDocument::AUTOLINK | \MarkdownDocument::TOC);
-               $html = $md->getHtml();
-
-               fclose($fd);
-
-               return $html;
-       }
-}