obus/docs/build.py
2021-07-31 03:39:26 +02:00

13 lines
452 B
Python

import glob
import os
# https://tex.stackexchange.com/questions/101717/converting-markdown-to-latex-in-latex/246871#246871
outfilename = '/tmp/out.md'
with open(outfilename, 'w') as outfile:
for filepath in glob.iglob('../src/modules/*/doc/index.md'):
with open(filepath) as infile:
outfile.write(infile.read())
outfile.write("\n\\newpage{}\n")
os.system(f"pandoc --from=markdown --output=docs.pdf {outfilename} --highlight-style=espresso")