From 8333ccec4afc5341a8a766f24fd4d2e1e16ddb9a Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Sat, 9 Mar 2024 18:54:29 +0100 Subject: [PATCH] docs: add generate_schema function to docs script --- ... generate_entry_figures_and_examples_and_schema.py} | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) rename docs/{generate_entry_figures_and_examples.py => generate_entry_figures_and_examples_and_schema.py} (97%) diff --git a/docs/generate_entry_figures_and_examples.py b/docs/generate_entry_figures_and_examples_and_schema.py similarity index 97% rename from docs/generate_entry_figures_and_examples.py rename to docs/generate_entry_figures_and_examples_and_schema.py index efb36b8..efe0c15 100644 --- a/docs/generate_entry_figures_and_examples.py +++ b/docs/generate_entry_figures_and_examples_and_schema.py @@ -17,7 +17,8 @@ import pypdfium2 # of using `import rendercv` because in order for that to work, the current working # directory must be the root of the project. To make it convenient for the user, I # import the modules using the full path of the files. -rendercv_path = pathlib.Path(__file__).parent.parent / "rendercv" +repository_root = pathlib.Path(__file__).parent.parent +rendercv_path = repository_root / "rendercv" def import_a_module(module_name: str, file_path: pathlib.Path): @@ -286,6 +287,13 @@ def generate_examples(): shutil.rmtree(rendercv_output_directory) +def generate_schema(): + """Generate the schema.""" + json_schema_file_path = repository_root / "schema.json" + dm.generate_json_schema_file(json_schema_file_path) + + if __name__ == "__main__": generate_entry_figures() generate_examples() + generate_schema()