From 8736bfc0521c63fe11034eb7ece1bc460ec0f545 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 13 Aug 2020 23:27:25 +0200 Subject: [PATCH] Add comment about auto-generated file [ci skip] --- website/setup/jinja_to_js.py | 8 ++++---- website/src/widgets/quickstart-training-generator.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/website/setup/jinja_to_js.py b/website/setup/jinja_to_js.py index 86a3f61a1..c320adeb6 100644 --- a/website/setup/jinja_to_js.py +++ b/website/setup/jinja_to_js.py @@ -1195,13 +1195,13 @@ def main( # fmt: on ): """Convert a jinja2 template to a JavaScript module.""" - compiler = JinjaToJS( - template_path.parent, template_path.parts[-1], js_module_format="es6" - ) + tpl_file = template_path.parts[-1] + compiler = JinjaToJS(template_path.parent, tpl_file, js_module_format="es6") + header = f"// This file was auto-generated by {__file__} based on {tpl_file}" result = compiler.get_output() if output is not None: with output.open("w") as f: - f.write(result) + f.write(f"{header}\n{result}") print(f"Updated {output.parts[-1]}") else: print(result) diff --git a/website/src/widgets/quickstart-training-generator.js b/website/src/widgets/quickstart-training-generator.js index a88f05884..ddad4f24a 100644 --- a/website/src/widgets/quickstart-training-generator.js +++ b/website/src/widgets/quickstart-training-generator.js @@ -1,3 +1,4 @@ +// This file was auto-generated by jinja_to_js.py based on quickstart_training.jinja import jinjaToJS from "jinja-to-js";export default function templateQuickstartTraining(ctx) { var __result = ""; var __tmp;