#! /usr/bin/env python # ---------------------------------------------------------------------- # Settings vardir = "./var" date_format = "%d-%b-%Y" # ---------------------------------------------------------------------- # functions def usage(): print("""Usage: gen.py file.in [...] Substitute placeholders in input files with content """) def gen_html(file): """Replace variables in the file with their content""" text = open(file).read() for var in vars: vartext = open(vardir + "/" + var).read() if var == "__navbar__": # Mark the link for the current file as active file2 = re.sub(r'.*/(.*).in', r'\1', file) vartext = re.sub(r'