diff --git a/components/style/list_properties.py b/components/style/list_properties.py index 63bbe2475118..671196167c97 100644 --- a/components/style/list_properties.py +++ b/components/style/list_properties.py @@ -21,4 +21,17 @@ }) 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)) diff --git a/components/style/properties.html.mako b/components/style/properties.html.mako new file mode 100644 index 000000000000..4785415a0f43 --- /dev/null +++ b/components/style/properties.html.mako @@ -0,0 +1,67 @@ + + +
+ + + + + +