From 332ca36327c7cd1020631a3bac9e03fcdeb3e5d2 Mon Sep 17 00:00:00 2001 From: Kay Date: Wed, 26 Jun 2024 02:22:40 +0800 Subject: [PATCH] docs: Fix playground not reading from _static in rtd --- docs/_static/playground.js | 2 +- docs/_static/playground_whl.py | 5 ++++- docs/playground/index.md | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/_static/playground.js b/docs/_static/playground.js index df57fb14..33505469 100644 --- a/docs/_static/playground.js +++ b/docs/_static/playground.js @@ -796,7 +796,7 @@ function _typeof(t) { t.next = 14; break } - o = "".concat(window.location.origin, "/").concat(window.location.pathname.split("/")[1], "/_static/"), a = n ? window.colorNotebook.notebookWheels : window.colorNotebook.playgroundWheels, s = [], n ? y = !0 : v = !0, l = r(a); + o = "".concat(window.location.origin, "/").concat(window.location.pathname.split("/")[1], "/wheels/"), a = n ? window.colorNotebook.notebookWheels : window.colorNotebook.playgroundWheels, s = [], n ? y = !0 : v = !0, l = r(a); try { for (l.s(); !(c = l.n()).done;)(u = c.value).endsWith(".whl") ? s.push(o + u) : s.push(u) } catch (t) { diff --git a/docs/_static/playground_whl.py b/docs/_static/playground_whl.py index 3d13b12b..c3d119aa 100644 --- a/docs/_static/playground_whl.py +++ b/docs/_static/playground_whl.py @@ -8,7 +8,7 @@ import urllib.request # Output files -OUTPUT_WHL = "docs/_static/" +OUTPUT_WHL = "docs/wheels/" OUTPUT_JS = "docs/_static/" # Build message output @@ -99,6 +99,9 @@ def download_wheel(url, dest): if os.path.exists("build"): shutil.rmtree("build") + if not os.path.exists("docs/wheels"): + os.mkdir("docs/wheels") + # Build wheel status, package = build_package() if not status: diff --git a/docs/playground/index.md b/docs/playground/index.md index 500dbc63..84a3cd04 100644 --- a/docs/playground/index.md +++ b/docs/playground/index.md @@ -8,7 +8,7 @@ hide: # 🎡️ Playground ```py play -# from bigtree import dict_to_tree +from bigtree import dict_to_tree path_dict = { "a": {"age": 90},