#!/usr/bin/env python # -*- encoding: utf-8 -*- "Update the workbook pages to work with Jekyll" import os HEADER = """--- layout: default title: %s base_url: %s --- """ def process_dir (dn,base,rel): s = '\n' return s txt = HEADER % ('Workbook', '../') + '\n'; txt += "

Workbook index

\n" txt += process_dir ("workbook",'', '../../'); with open('workbook.html', 'w') as f: f.write(txt) print 'Done'