Skip to content

Commit 6323840

Browse files
committed
Update the Download page to use cs setup.
Also recommend VS Code with Metals. Code-wise, we inline the data that were in `_data/downloads.yml` and `_data/tutorials.yml` as well as inline and unroll the logic that was in `_includes/tutorial-list.html`. Those were only used once, and it is much easier to edit them in-place, not to mention that it is actually works with jekyll's incremental builds, unlike the `_data`-based approach.
1 parent 2618e34 commit 6323840

File tree

6 files changed

+59
-78
lines changed

6 files changed

+59
-78
lines changed

_data/downloads.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

_data/tutorials.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

_includes/tutorial-list.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

_layouts/downloadpage.html

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,65 @@
1616
</ul>
1717
</div>
1818
<div class="main-download">
19-
<h2>The most popular way to get Scala is either using Scala through sbt, the Scala build tool, or to use Scala through an IDE.</h2>
19+
<h2>The easiest way to install Scala is through coursier.</h2>
2020
<div class="install-steps">
2121
<div class="step">
2222
<img src="/resources/img/download/arrow-asset.png" alt="">
2323
<div class="number-step">1</div>
2424
<div class="text-step">
25-
<h3>First, make sure you have the Java 8 JDK (or Java 11 JDK) installed.</h3>
26-
<p>To check, open the terminal and type:</p>
27-
<p><code>java -version</code><span>(Make sure you have version 1.8 or 11.)</span></p>
28-
<p><i>(If you don't have it installed, download Java from <a href="https://www.oracle.com/java/technologies/javase-jdk8-downloads.html">Oracle Java 8</a>, <a href="https://www.oracle.com/java/technologies/javase-jdk11-downloads.html">Oracle Java 11</a>, or <a href="https://adoptopenjdk.net/">AdoptOpenJDK 8/11</a>. Refer <a href="https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html">JDK Compatibility</a> for Scala/Java compatiblity detail.</i></p>
25+
<h3>First, install Java, Scala, and all related command-line tools.</h3>
26+
<div id="download-step-one">
27+
<p>Download <a href="https://get-coursier.io/docs/cli-overview.html#install-native-launcher">the native launcher of coursier</a> then install everything with:</p>
28+
<p><code>$ ./cs setup</code><span> (Adapt to your operating system)</span></p>
29+
</div>
30+
<p>(See <a href="https://get-coursier.io/docs/cli-overview.html#install-native-launcher">the instructions for other operating systems</a>.)
2931
</div>
3032
</div>
3133
<div class="step">
3234
<div class="number-step">2</div>
3335
<div class="text-step">
34-
<h3>Then, install Scala:</h3>
35-
<p>...either by installing an IDE such as IntelliJ, or sbt, Scala's build tool.</p>
36+
<h3><i>(Optional)</i> Then, install an IDE for Scala.</h3>
37+
<p>The two most popular IDEs for Scala are IntelliJ and VS Code with Metals.</p>
3638
</div>
3739
</div>
3840
<div class="download-options">
3941
<div class="download-intellij">
4042
<span class="or">or</span>
4143
<div class="description">
4244
<img src="/resources/img/download/arrow-left.png" alt="">
43-
<p>Best if you prefer a full-featured IDE (recommended for beginners)</p>
45+
<p>Best if you prefer to start without a build tool (recommended for beginners)</p>
4446
</div>
4547
<a href="" class="btn-download" id="download-intellij-link">
4648
<i class="fa fa-download"></i>
47-
<span>Download intellij</span>
49+
<span>Download IntelliJ</span>
4850
</a>
4951
<ul>
50-
{% include tutorial-list.html column=1 %}
52+
<li><a href="/documentation/getting-started-intellij-track/getting-started-with-scala-in-intellij.html"><i class="fa fa-file-text-o"></i>Getting Started with Scala in IntelliJ</a></li>
53+
<li><a href="/documentation/getting-started-intellij-track/building-a-scala-project-with-intellij-and-sbt.html"><i class="fa fa-file-text-o"></i>Building a Scala Project with IntelliJ and sbt</a></li>
54+
<li><a href="/documentation/getting-started-intellij-track/testing-scala-in-intellij-with-scalatest.html"><i class="fa fa-file-text-o"></i>Testing Scala in IntelliJ with ScalaTest</a></li>
5155
</ul>
5256
</div>
53-
<div class="download-sbt">
57+
<div class="download-vscode">
5458
<div class="description">
5559
<img src="/resources/img/download/arrow-right.png" alt="">
56-
<p>Best if you are familiar with the command line</p>
60+
<p>Best if you are familiar with the command line and build tools</p>
5761
</div>
58-
<a href="" class="btn-download" id="download-sbt-link">
62+
<a href="" class="btn-download" id="download-vscode-link">
5963
<i class="fa fa-download"></i>
60-
<span>Download Sbt</span>
64+
<span>Download VS Code</span>
6165
</a>
6266
<ul>
63-
{% include tutorial-list.html column=0 %}
67+
<li><a href="https://scalameta.org/metals/docs/editors/vscode.html"><i class="fa fa-file-text-o"></i>Getting Started with Scala in VS Code</a></li>
68+
<li><a href="/documentation/getting-started-sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html"><i class="fa fa-file-text-o"></i>Getting Started with Scala and sbt on the Command Line</a></li>
69+
<li><a href="/documentation/getting-started-sbt-track/testing-scala-with-sbt-on-the-command-line.html"><i class="fa fa-file-text-o"></i>Testing Scala with sbt and ScalaTest on the Command Line</a></li>
6470
</ul>
6571
</div>
6672
</div>
6773

6874
<p class="bottom-lead">
69-
Compared to other programming languages, installing Scala is a bit unusual. Scala is unusual because it is usually installed for each of your Scala projects rather than being installed system-wide. Both of the above options manage (via sbt) a specific Scala version per Scala project you create.
70-
<br><br>
71-
But it's also possible to "install" Scala in numerous other ways; e.g., grab Scala binaries and use Scala from the command line or use Scala in your browser!
72-
<br><br>
75+
Compared to other programming languages, installing Scala is a bit unusual.
76+
In addition to the system-wide installation mentioned above, build tools such as sbt will automatically manage a specific Scala version per Scala project you create.
77+
This makes sure that there are no version conflicts between different Scala projects on your computer.
7378
</p>
7479

7580
<!-- <p class="bottom-lead"><h2>Other</h2></p> -->
@@ -108,11 +113,32 @@ <h3>License</h3>
108113
</div>
109114
</div>
110115

111-
{% for step in site.data.downloads.stepOne %}
112-
<div style="display:none" id="stepOne-{{step.os}}">{{step.text}}</div>
113-
{% endfor %} {% for intellijUrl in site.data.downloads.intellijUrls %}
114-
<div style="display:none" id="intellij-{{intellijUrl.os}}">{{intellijUrl.url}}</div>
115-
{% endfor %} {% for sbtUrl in site.data.downloads.sbtUrls %}
116-
<div style="display:none" id="sbt-{{sbtUrl.os}}">{{sbtUrl.url}}</div>
117-
{% endfor %}
116+
<!-- Hidden elements whose content are used to provide OS-specific download instructions.
117+
-- This is handled in `resources/js/functions.js`.
118+
-->
119+
120+
<div style="display:none" id="stepOne-linux">
121+
<p><code>$ curl -Lo cs https://git.io/coursier-cli-linux && chmod +x cs && ./cs setup</code></p>
122+
</div>
123+
<div style="display:none" id="stepOne-unix">
124+
<p>Follow <a href="https://get-coursier.io/docs/cli-overview.html#install-native-launcher" target="_blank">the instructions to install the <code>cs</code> launcher</a> then run:</p>
125+
<p><code>$ ./cs setup</code></p>
126+
</div>
127+
<div style="display:none" id="stepOne-macos">
128+
<p><code>$ curl -Lo cs https://git.io/coursier-cli-macos && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup</code></p>
129+
<p><span>Alternatively you can use Homebrew: </span><code>$ brew install coursier/formulas/coursier && cs setup</code></p>
130+
</div>
131+
<div style="display:none" id="stepOne-windows">
132+
<p>Download and execute <a href="https://git.io/coursier-cli-windows-exe">the Scala installer for Windows</a> based on coursier</p>
133+
</div>
134+
135+
<div style="display:none" id="intellij-linux">https://www.jetbrains.com/idea</div>
136+
<div style="display:none" id="intellij-unix">https://www.jetbrains.com/idea</div>
137+
<div style="display:none" id="intellij-macos">https://www.jetbrains.com/idea</div>
138+
<div style="display:none" id="intellij-windows">https://www.jetbrains.com/idea</div>
139+
140+
<div style="display:none" id="vscode-linux">https://code.visualstudio.com/download</div>
141+
<div style="display:none" id="vscode-unix">https://code.visualstudio.com/download</div>
142+
<div style="display:none" id="vscode-macos">https://code.visualstudio.com/download</div>
143+
<div style="display:none" id="vscode-windows">https://code.visualstudio.com/download</div>
118144
</section>

_sass/layout/download.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
margin-top: 38px;
114114

115115
.download-intellij,
116-
.download-sbt {
116+
.download-vscode {
117117
position: relative;
118118
@include span-columns(4 of 8);
119119
@include bp(large) {
@@ -130,7 +130,7 @@
130130
padding: 16px 0;
131131
border-radius: 100px;
132132
font-weight: $font-bold;
133-
margin-bottom: 34px;
133+
margin-bottom: 20px;
134134

135135
&:active,
136136
&:focus,
@@ -185,6 +185,7 @@
185185
color: $brand-primary;
186186
width: 280px;
187187
font-family: 'Kalam', cursive;
188+
margin-top: 15px;
188189

189190
img {
190191
width: 92px;
@@ -212,11 +213,11 @@
212213
}
213214
}
214215

215-
.download-sbt {
216+
.download-vscode {
216217
padding-left: 10px;
217218
}
218219

219-
.download-sbt {
220+
.download-vscode {
220221
.description {
221222
top: 60px;
222223
left: auto;

resources/js/functions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ $(document).ready(function() {
261261
if ($(".main-download").length) {
262262
var os = getOS();
263263
var intelliJlink = $("#intellij-" + os).text();
264-
var sbtLink = $("#sbt-" + os).text();
264+
var vsCodeLink = $("#vscode-" + os).text();
265265
var stepOneContent = $("#stepOne-" + os).html()
266266
$("#download-intellij-link").attr("href", intelliJlink);
267-
$("#download-sbt-link").attr("href", sbtLink);
267+
$("#download-vscode-link").attr("href", vsCodeLink);
268268
$("#download-step-one").html(stepOneContent);
269269
}
270270
});

0 commit comments

Comments
 (0)