erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.74k stars 1.12k forks source link

Parsing a markdown page to html page #702

Closed mcuix closed 5 years ago

mcuix commented 5 years ago

What would the correct syntax be for parsing an entire markdown file to html output? For example test.md --> test.html

BenjaminHoegh commented 5 years ago

Just to be sure, do you want it to export a html file or just show html code ?

if you just wanna paste a markdown file into a html you can use echo $Parsedown->text(file_get_contents('myFile.md'));

mcuxdk commented 5 years ago

I have a MD file that needs to be converted to html. Can parsedown be used for this purpose?

mcuix commented 5 years ago

Ok. Got it to work.

<?php
include 'Parsedown.php';
$Parsedown = new Parsedown();
echo $Parsedown->text(file_get_contents('test.md'));
?>