Skip to content

Commit 6bceea2

Browse files
quickstart guide
1 parent 6e06074 commit 6bceea2

29 files changed

+7399
-142
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ val modulesUsingJava11 = with(projects) {
150150
dataframeJupyter,
151151
dataframeGeo,
152152
examples.ideaExamples.titanic,
153+
tests,
153154
)
154155
}.map { it.path }
155156

docs/StardustDocs/cfg/buildprofiles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<analytics-head-script-file>resize-iframes.js</analytics-head-script-file>
1717
<enable-browser-edits>true</enable-browser-edits>
1818
<browser-edits-url>https://github.com/Kotlin/dataframe/edit/master/docs/StardustDocs/</browser-edits-url>
19+
<include-in-head>include-head.html</include-in-head>
1920
</variables>
2021
<sitemap change-frequency="monthly"/>
2122
<build-profile instance="d">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<script src="static/custom.js"></script>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
window.addEventListener('load', function () {
2+
function sendTheme(theme, iframe) {
3+
const maxAttempts = 10;
4+
const interval = 200; // 200ms
5+
let attempts = 0;
6+
7+
function attemptSend() {
8+
if (attempts >= maxAttempts) return;
9+
iframe.contentWindow.postMessage({ type: 'setTheme', theme }, '*');
10+
attempts++;
11+
}
12+
13+
attemptSend();
14+
const intervalId = setInterval(() => {
15+
attemptSend();
16+
if (attempts >= maxAttempts) clearInterval(intervalId);
17+
}, interval);
18+
}
19+
20+
function setIframeHeight(iframe, height) {
21+
iframe.style.height = height + 'px';
22+
}
23+
24+
const htmlElement = document.documentElement;
25+
26+
function getCurrentTheme() {
27+
return htmlElement.classList.contains('theme-light') ? 'light' : 'dark';
28+
}
29+
30+
window.addEventListener('message', (event) => {
31+
if (event.data.type === 'iframeHeight') {
32+
document.querySelectorAll('iframe').forEach((iframe) => {
33+
if (iframe.contentWindow === event.source) {
34+
setIframeHeight(iframe, event.data.height);
35+
}
36+
});
37+
}
38+
});
39+
40+
function updateAllIframeThemes() {
41+
const theme = getCurrentTheme();
42+
document.querySelectorAll('iframe').forEach((iframe) => {
43+
if (iframe.contentWindow) {
44+
sendTheme(theme, iframe);
45+
}
46+
});
47+
}
48+
49+
const observer = new MutationObserver(() => {
50+
updateAllIframeThemes();
51+
});
52+
53+
observer.observe(htmlElement, { attributes: true });
54+
55+
function observeIframeLoad(iframe) {
56+
iframe.addEventListener('load', () => sendTheme(getCurrentTheme(), iframe));
57+
if (iframe.contentDocument && iframe.contentDocument.readyState === 'complete') {
58+
sendTheme(getCurrentTheme(), iframe);
59+
}
60+
}
61+
62+
document.querySelectorAll('iframe').forEach(observeIframeLoad);
63+
64+
const bodyObserver = new MutationObserver((mutations) => {
65+
mutations.forEach((mutation) => {
66+
mutation.addedNodes.forEach((node) => {
67+
if (node.tagName === 'IFRAME') observeIframeLoad(node);
68+
else if (node.querySelectorAll) node.querySelectorAll('iframe').forEach(observeIframeLoad);
69+
});
70+
});
71+
});
72+
73+
bodyObserver.observe(document.body, { childList: true, subtree: true });
74+
75+
updateAllIframeThemes();
76+
});

docs/StardustDocs/d.tree

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
<instance-profile id="d"
66
name="Dataframe"
77
status="release"
8-
start-page="overview.md">
8+
start-page="Home.topic">
9+
<toc-element topic="Home.topic"/>
10+
<toc-element topic="Guides.md">
11+
<toc-element topic="quickstart.md"/>
12+
</toc-element>
13+
914
<toc-element topic="gettingStarted.md" accepts-web-file-names="installation.html">
15+
<toc-element topic="gettingStartedKotlinNotebook.md"/>
1016
<toc-element topic="gettingStartedGradle.md"/>
1117
<toc-element topic="gettingStartedJupyterNotebook.md"/>
1218
<toc-element topic="gettingStartedDatalore.md"/>
@@ -192,4 +198,5 @@
192198
<toc-element topic="Trobleshooting.md"/>
193199
</toc-element>
194200
<toc-element href="https://github.com/Kotlin/dataframe/tree/master/examples" toc-title="Examples"/>
201+
<toc-element topic="_shadow_resources.md" hidden="true"/>
195202
</instance-profile>

0 commit comments

Comments
 (0)