Skip to content

Commit 220252f

Browse files
author
Andrey Cheptsov
committed
Enhance installation documentation and improve carousel functionality on landing page
1 parent 67c16f0 commit 220252f

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Configuration is updated at ~/.dstack/config.yml
9090

9191
### Install agent skills
9292

93-
Install [skills](https://skills.sh/dstackai/dstack/dstack) to help AI agents use the `dstack` CLI and edit configuration files.
93+
Install [`dstack` skills](https://skills.sh/dstackai/dstack/dstack) to help AI agents use the CLI and edit configuration files.
9494

9595
```shell
9696
$ npx skills add dstackai/dstack

docs/docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ This configuration is stored in `~/.dstack/config.yml`.
197197

198198
## Install agent skills
199199

200-
Install [skills](https://skills.sh/dstackai/dstack/dstack) to help AI agents use the `dstack` CLI and edit configuration files.
200+
Install [`dstack` skills](https://skills.sh/dstackai/dstack/dstack) to help AI agents use the CLI and edit configuration files.
201201

202202
<div class="termy">
203203

docs/overrides/home.html

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,48 @@
8383
return termynal;
8484
}
8585

86+
function normalizeCarouselHeight(carousel) {
87+
var slidesWrap = carousel.querySelector('.code-carousel__slides');
88+
if (!slidesWrap) return;
89+
90+
var slides = Array.prototype.slice.call(carousel.querySelectorAll('.code-carousel__slide'));
91+
if (!slides.length) return;
92+
93+
var maxHeight = 0;
94+
95+
slides.forEach(function(slide) {
96+
var prevDisplay = slide.style.display;
97+
var prevVisibility = slide.style.visibility;
98+
99+
if (!slide.classList.contains('active')) {
100+
slide.style.display = 'block';
101+
slide.style.visibility = 'hidden';
102+
}
103+
104+
maxHeight = Math.max(maxHeight, slide.scrollHeight, slide.offsetHeight);
105+
106+
if (!slide.classList.contains('active')) {
107+
slide.style.display = prevDisplay;
108+
slide.style.visibility = prevVisibility;
109+
}
110+
});
111+
112+
if (maxHeight > 0) {
113+
slidesWrap.style.minHeight = maxHeight + 'px';
114+
slides.forEach(function(slide) {
115+
slide.style.minHeight = maxHeight + 'px';
116+
});
117+
}
118+
}
119+
86120
// Init termynal instances for carousel slides
87121
window._getStartedTermynal = initCarouselTermynal('get-started-code-snippet', [
88122
{type: 'input', value: 'uv tool install "dstack[all]" -U'},
123+
{delay: 0, value: 'Downloading dstack-0.20.15-py3-none-any.whl', class: 'newline'},
124+
{type: 'progress', progressPercent: 100, typeDelay: 50},
89125
{delay: 0, value: ' ', class: 'newline'},
90126
{type: 'input', value: 'npx skills add dstackai/dstack'},
127+
{delay: 0, value: 'Installed skill dstack from dstackai/dstack', class: 'newline'},
91128
{delay: 0, value: ' ', class: 'newline'},
92129
{type: 'input', value: 'dstack server'},
93130
{delay: 0, value: ' ', class: 'newline'},
@@ -112,8 +149,6 @@
112149
{delay: 0, value: ' - Troubleshoot provisioning or connectivity issues', class: 'newline'},
113150
{delay: 0, value: ' ', class: 'newline'},
114151
{delay: 0, value: ' What would you like to do?', class: 'newline'},
115-
{delay: 0, value: ' ', class: 'newline'},
116-
{type: 'input', value: ''},
117152
]);
118153

119154
window._fleetTermynal = initCarouselTermynal('fleet-apply-terminal', [
@@ -231,8 +266,19 @@
231266
});
232267
});
233268

269+
normalizeCarouselHeight(carousel);
270+
setTimeout(function() {
271+
normalizeCarouselHeight(carousel);
272+
}, 350);
273+
234274
timer = setInterval(next, 5000);
235275
});
276+
277+
window.addEventListener('resize', function() {
278+
document.querySelectorAll('.code-carousel').forEach(function(carousel) {
279+
normalizeCarouselHeight(carousel);
280+
});
281+
});
236282
});
237283
</script>
238284
{% endblock %}

0 commit comments

Comments
 (0)