*/ class ArticleGenerator { function newArticle($directory, $articlefile) { $article = file_get_contents($directory . $articlefile); echo "
"; if(substr($article, 0, 6) == "%TITLE"){ $title = substr($article, 8, strpos($article, "\n") - 8); $link = "./?article=" . substr($articlefile, 0, -3); echo "

$title

"; $article = substr($article, strpos($article, "\n") + 1); } if(substr($article, 0, 5) == "%DATE"){ $date = substr($article, 7, strpos($article, "\n") - 7); echo "$date"; $article = substr($article, strpos($article, "\n") + 1); } //TODO Code detection echo Parsedown::instance() ->setBreaksEnabled(true) ->text($article); echo "
" . "\n"; } }