diff --git a/docs/conf.py b/docs/conf.py index cad94ce..537ae78 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,6 +32,12 @@ ROOT = HERE.parent APP_PKG = ROOT / "packages/ipydrawio/package.json" APP_DATA = json.loads(APP_PKG.read_text(encoding="utf-8")) RTD = json.loads(os.environ.get("READTHEDOCS", "False").lower()) +RTD_TASKS = [ + "build", + "setup:pip:check", + "docs:typedoc:mystify", + "demo", +] # metadata author = APP_DATA["author"] @@ -127,19 +133,8 @@ def clean_schema(app: Sphinx, error): def before_rtd_build(app: Sphinx, error): """performs the full frontend build, and ensures the typedoc""" - for task in [ - "build", - "setup:pip:check", - "docs:typedoc:mystify", - "demo", - ]: - subprocess.check_call( - [ - "doit", - task, - ], - cwd=str(ROOT), - ) + for task in RTD_TASKS: + subprocess.check_call(["doit", task], cwd=str(ROOT)) def setup(app): diff --git a/dodo.py b/dodo.py index ca15b29..9d097ea 100644 --- a/dodo.py +++ b/dodo.py @@ -675,11 +675,16 @@ def task_demo(): return demo_dest = [] + demo_tasks = [] + final_dest = [] for path in P.ALL_DEMO_CONTENTS: + name = f"stage:{path.name}" dest = P.DEMO / path.name.replace(" ", "_") demo_dest += [dest] + demo_tasks += [f"demo:{name}"] + final_dest += [P.DEMO_BUILD / f"files/{path.name}"] yield dict( - name=f"stage:{path.name}", + name=name, file_dep=[path], targets=[dest], actions=[(P._copy_one, [path, dest])], @@ -696,8 +701,9 @@ def task_demo(): yield dict( name="archive", + task_dep=demo_tasks, file_dep=[*demo_dest, *lite_src_files], - targets=[P.DEMO_ARCHIVE, P.DEMO_HASHES], + targets=[P.DEMO_ARCHIVE, P.DEMO_HASHES, *final_dest, P.DEMO_CONTENTS_API], actions=[P._build_lite], ) diff --git a/scripts/project.py b/scripts/project.py index 2324a90..2512e5c 100644 --- a/scripts/project.py +++ b/scripts/project.py @@ -336,6 +336,7 @@ DEMO_CONFIG = DEMO / "jupyter_config.json" DEMO_APPS = ["lab"] DEMO_BUILD = BUILD / "demo" DEMO_HASHES = DEMO_BUILD / "SHA256SUMS" +DEMO_CONTENTS_API = DEMO_BUILD / "api/contents/all.json" DEMO_ARCHIVE = ( DEMO_BUILD / f"""ipydrawio-lite-{JS_PKG_DATA["ipydrawio"]["version"]}.tgz""" )