Skip to content

Commit 70910c4

Browse files
committed
Update the Download page to use cs setup.
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 255d5a4 commit 70910c4

File tree

5 files changed

+38
-74
lines changed

5 files changed

+38
-74
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: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,24 @@
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>Then, install an IDE, or get started with sbt</h3>
3637
</div>
3738
</div>
3839
<div class="download-options">
@@ -42,34 +43,36 @@ <h3>Then, install Scala:</h3>
4243
<img src="/resources/img/download/arrow-left.png" alt="">
4344
<p>Best if you prefer a full-featured IDE (recommended for beginners)</p>
4445
</div>
45-
<a href="" class="btn-download" id="download-intellij-link">
46+
<a href="https://www.jetbrains.com/idea/download/" class="btn-download">
4647
<i class="fa fa-download"></i>
47-
<span>Download intellij</span>
48+
<span>Download IntelliJ</span>
4849
</a>
4950
<ul>
50-
{% include tutorial-list.html column=1 %}
51+
<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>
52+
<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>
53+
<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>
5154
</ul>
5255
</div>
5356
<div class="download-sbt">
5457
<div class="description">
5558
<img src="/resources/img/download/arrow-right.png" alt="">
5659
<p>Best if you are familiar with the command line</p>
5760
</div>
58-
<a href="" class="btn-download" id="download-sbt-link">
61+
<a href="/documentation/getting-started-sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html" class="btn-download" id="download-sbt-link">
5962
<i class="fa fa-download"></i>
60-
<span>Download Sbt</span>
63+
<span>Get started with sbt</span>
6164
</a>
6265
<ul>
63-
{% include tutorial-list.html column=0 %}
66+
<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>
67+
<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>
6468
</ul>
6569
</div>
6670
</div>
6771

6872
<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>
73+
Compared to other programming languages, installing Scala is a bit unusual.
74+
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.
75+
This makes sure that there are no version conflicts between different Scala projects on your computer.
7376
</p>
7477

7578
<!-- <p class="bottom-lead"><h2>Other</h2></p> -->
@@ -108,11 +111,22 @@ <h3>License</h3>
108111
</div>
109112
</div>
110113

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 %}
114+
<!-- Hidden elements whose content are used to provide OS-specific download instructions.
115+
-- This is handled in `resources/js/functions.js`.
116+
-->
117+
118+
<div style="display:none" id="stepOne-linux">
119+
<p><code>$ curl -Lo cs https://git.io/coursier-cli-linux && chmod +x cs && ./cs setup</code></p>
120+
</div>
121+
<div style="display:none" id="stepOne-unix">
122+
<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>
123+
<p><code>$ ./cs setup</code></p>
124+
</div>
125+
<div style="display:none" id="stepOne-macos">
126+
<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>
127+
<p><span>Alternatively you can use Homebrew: </span><code>$ brew install coursier/formulas/coursier && cs setup</code></p>
128+
</div>
129+
<div style="display:none" id="stepOne-windows">
130+
<p>Download and execute <a href="https://git.io/coursier-cli-windows-exe">the Scala installer for Windows</a> based on coursier</p>
131+
</div>
118132
</section>

resources/js/functions.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,7 @@ function getOS() {
260260
$(document).ready(function() {
261261
if ($(".main-download").length) {
262262
var os = getOS();
263-
var intelliJlink = $("#intellij-" + os).text();
264-
var sbtLink = $("#sbt-" + os).text();
265263
var stepOneContent = $("#stepOne-" + os).html()
266-
$("#download-intellij-link").attr("href", intelliJlink);
267-
$("#download-sbt-link").attr("href", sbtLink);
268264
$("#download-step-one").html(stepOneContent);
269265
}
270266
});

0 commit comments

Comments
 (0)