Skip to content

Commit 0347b8a

Browse files
committed
fix idom doc server location
1 parent cc5c7d3 commit 0347b8a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

docs/source/_exts/interactive_widget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from sphinx.application import Sphinx
66

77

8-
_IDOM_SERVER_LOC = os.environ.get("IDOM_DOC_EXAMPLE_SERVER_HOST", "") + "/_idom"
8+
_IDOM_SERVER_LOC = os.environ.get("IDOM_DOC_EXAMPLE_SERVER_HOST", "")
99

1010

1111
class IteractiveWidget(Directive):
@@ -26,7 +26,7 @@ def run(self):
2626
<div id="{container_id}" class="interactive widget-container center-content" style="" />
2727
<script async type="module">
2828
import loadWidgetExample from "/_static/js/load-widget-example.js";
29-
loadWidgetExample("{_IDOM_SERVER_LOC}", "{container_id}", "{view_id}");
29+
loadWidgetExample("{_IDOM_SERVER_LOC}", "/_idom", "{container_id}", "{view_id}");
3030
</script>
3131
</div>
3232
""",

docs/source/_static/js/load-widget-example.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
export default function loadWidgetExample(idomServerLocation, mountID, viewID) {
1+
export default function loadWidgetExample(
2+
idomServerHost,
3+
idomServerPath,
4+
mountID,
5+
viewID
6+
) {
27
const loc = window.location;
3-
const idom_url = "//" + (idomServerLocation || loc.host);
8+
const idom_url = "//" + (idomServerHost || loc.host) + idomServerPath;
49
const http_proto = loc.protocol;
510
const ws_proto = http_proto === "https:" ? "wss:" : "ws:";
611

0 commit comments

Comments
 (0)