3 namespace mdref\Formatter
;
10 class Discount
extends Formatter
{
12 function formatString(string $string) : string {
13 $md = \MarkdownDocument
::createFromString($string);
14 $md->compile(\MarkdownDocument
::AUTOLINK
);
15 return $md->getHtml();
18 function formatFile(string $file) : string {
19 $fd = fopen($file, "r");
21 throw Exception
::fromLastError();
24 $md = \MarkdownDocument
::createFromStream($fd);
25 $md->compile(\MarkdownDocument
::AUTOLINK | \MarkdownDocument
::TOC
);
26 $html = $md->getHtml();