import glob from pathlib import Path import subprocess specials = ["footer", "todo"] for filename in specials: with open(filename+".html", "w") as outfile: subprocess.run(["pandoc", f"{filename}.md"], stdout=outfile) for filename in glob.glob("*.md"): filename = Path(filename).stem if filename in specials: continue with open(filename+".html", "w") as outfile: subprocess.run(["pandoc", "--toc", "--css=github-pandoc.css", "-A", "footer.html", "--standalone", f"{filename}.md"], stdout=outfile)