from os.path import join
import os
import subprocess as sp

home = os.path.expanduser('~')
markdown = join("..",'code','markdown.py')

for short in 'sweetie-porked','doing-bloom','sbelle-satisfied':
    dest = join('../freenet/timelaid/',short+'.html')
    src = join('spoilers',short+'.md')
    if not os.path.exists(dest) or os.stat(dest).st_mtime < os.stat(src).st_mtime:
        print('make',short)
        with open(dest,'wt') as out:
            sp.call(['python',markdown,src],stdout=out)
