Generate html and json of supported css properties.

Outputs html and json file of supported css properties to target/doc/
directory when deploying github-pages.
This commit is contained in:
Jussi Räsänen 2016-03-26 21:23:16 +02:00
parent 803f39df19
commit e576fe94b2
3 changed files with 83 additions and 1 deletions

View file

@ -21,4 +21,17 @@ properties = dict(
})
for p in template.module.LONGHANDS + template.module.SHORTHANDS
)
print(json.dumps(properties, indent=4))
json_dump = json.dumps(properties, indent=4)
#
# Resolve path to doc directory and write CSS properties and JSON.
#
servo_doc_path = os.path.abspath(os.path.join(style, '../', '../', 'target', 'doc', 'servo'))
with open(os.path.join(servo_doc_path, 'css-properties.json'), "w") as out_file:
out_file.write(json_dump)
html_template = Template(filename=os.path.join(style, "properties.html.mako"), input_encoding='utf8')
with open(os.path.join(servo_doc_path, 'css-properties.html'), "w") as out_file:
out_file.write(html_template.render(properties=properties))