themes.py
Python script, ASCII text executable
1#!/usr/bin/python3 2 3import lxml.etree as ET 4 5dom = ET.parse("themes.xml") 6xslt = ET.parse("themes.xsl") 7transform = ET.XSLT(xslt) 8newdom = transform(dom) 9with open("themes.html", "w") as file: 10file.write("""<!--DO NOT EDIT THIS FILE MANUALLY. 11This file, themes.html, is automatically generated using the Python script: themes.py. 12 13That script uses 2 other files that you may want to edit instead: themes.xml, themes.xsl. 14* themes.xml includes all data, 15* themes.xsl includes instructions for the Python script on how to render that data into valid HTML. 16 17You may also want to edit themes.css, which is the stylesheet for this specific page. 18 19I know all these files are named exactly the same, that's literally just so that they appear next to eachother---it's so nice. 20-->""" + str(newdom)) 21