Where markdown=markdown language file and $output is your outputfile.html
pandoc -f markdown $markdown -t html5 --toc --toc-depth=1 > $output