From 0dc12b2f9b4db34e89ad7f5d83531d4cbac7f932 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 19 Feb 2022 10:29:17 +0000 Subject: (check): Determine and use the first template when running docgen Signed-off-by: Daniel Silverstone --- check | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'check') diff --git a/check b/check index 00fb41c..4db9f92 100755 --- a/check +++ b/check @@ -131,7 +131,7 @@ class Runcmd: **kwargs, ) - def docgen(self, md, output, **kwargs): + def docgen(self, md, template, output, **kwargs): """Run the Subplot document generator""" # GitLab CI, and other CI engines, runs tests under Docker, which uses @@ -155,6 +155,7 @@ class Runcmd: "--", f"--resources={os.path.abspath('share')}", "docgen", + f"--template={template}", md, f"--output={output}", ], @@ -271,7 +272,11 @@ def check_subplots(r): md = os.path.basename(md0) base, _ = os.path.splitext(md) + doc_template = None + for template in r.get_templates(md0): + if doc_template is None: + doc_template = template if template == "python": test_py = os.path.join(output, f"test-{base}.py") test_log = os.path.join(output, f"test-{base}.log") @@ -309,8 +314,8 @@ def check_subplots(r): base = os.path.basename(md) base, _ = os.path.splitext(md) base = os.path.join(output, base) - r.docgen(md, base + ".pdf", cwd=dirname) - r.docgen(md, base + ".html", cwd=dirname) + r.docgen(md, doc_template, base + ".pdf", cwd=dirname) + r.docgen(md, doc_template, base + ".html", cwd=dirname) def tail(filename, numlines=100): -- cgit v1.2.1