import sys import json import html def escape(text): if type(text) is str: return html.escape(text) else: return "(null)" def nlescape(text): return escape(text).replace('\n','
') infile = json.load(open(sys.argv[1] if len(sys.argv) >= 2 else 'stories.json')) index = open('index.html', 'w', encoding='utf-8') index.write(""" AI Dungeon Archive

AI Dungeon Archive

Stories

Scenarios

') index.close()