Skip to content

Commit b04afc8

Browse files
authored
Add scala-js and scala-native installation (#216)
1 parent 408598d commit b04afc8

File tree

4 files changed

+54
-13
lines changed

4 files changed

+54
-13
lines changed

website/docs/_advanced_install.mdx

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import DownloadButton from "../src/components/DownloadButton"
55
import {currentOs} from "../src/components/osUtils";
66

77
<SectionAbout title="Advanced Installation">
8-
<div class="margin--lg"/>
8+
<div className="margin--lg"/>
99
<Tabs
1010
groupId="operating-systems-specific"
1111
defaultValue={currentOs()}
@@ -232,7 +232,7 @@ brew install Virtuslab/scala-cli/scala-cli
232232

233233

234234
<SectionAbout title="Standalone launcher">
235-
<div class="margin--lg"/>
235+
<div className="margin--lg"/>
236236
<Tabs
237237
defaultValue={currentOs() == 'win' ? 'windows' : 'macOS/Linux'}
238238
groupId="specific-standalone-launcher"
@@ -268,7 +268,7 @@ Script to automatically download and cache standalone `scala-cli` launcher.
268268

269269

270270
<SectionAbout title="Shell completions">
271-
<div class="margin--lg"/>
271+
<div className="margin--lg"/>
272272
<Tabs
273273
defaultValue={currentOs() == 'mac' ? 'zsh' : 'bash'}
274274
groupId="shell-specific"
@@ -283,11 +283,31 @@ Script to automatically download and cache standalone `scala-cli` launcher.
283283

284284

285285
Try the completions with
286+
287+
<Tabs groupId="shell-specific"
288+
defaultValue="bash"
289+
values={[
290+
{label: 'Bash', value: 'bash'},
291+
{label: 'zsh', value: 'zsh'},
292+
]}>
293+
<TabItem value="bash">
294+
295+
```
296+
eval "$(scala-cli install completions --env --shell bash)"
297+
scala-cli --<TAB>
298+
```
299+
300+
</TabItem>
301+
<TabItem value="zsh">
302+
286303
```
287-
eval "$(scala-cli install completions --env)"
304+
eval "$(scala-cli install completions --env --shell zsh)"
288305
scala-cli --<TAB>
289306
```
290307

308+
</TabItem>
309+
</Tabs>
310+
291311
Install them on your system with
292312
```bash
293313
scala-cli install completions
@@ -315,4 +335,22 @@ scala-cli install completions --shell zsh
315335

316336
</TabItem>
317337
</Tabs>
338+
</div></div>
339+
340+
<div id="scala-js"/>
341+
<SectionAbout title="Scala JS"/>
342+
<div className="row"><div className="col col--9 col--offset-1 padding--lg advanced_install_methods">
343+
344+
To run Scala JS applications [Node.js](https://nodejs.org/) needs to be installed. Scala CLI at this moment does not manage Node.js however it may change in the future.
345+
346+
</div></div>
347+
348+
<div id="scala-native"/>
349+
<SectionAbout title="Scala Native"/>
350+
<div className="row"><div className="col col--9 col--offset-1 padding--lg advanced_install_methods">
351+
352+
[Clang](https://llvm.org/docs/GettingStarted.html#requirements) is required to compile and run Scala Native applications. Using some functionalities known from JDK (like using `java.util.zip` package) require additional packages to be installed.
353+
354+
Scala Native page contains detailed [installation guide](https://scala-native.readthedocs.io/en/latest/user/setup.html#installing-clang-and-runtime-dependencies).
355+
318356
</div></div>

website/src/components/SectionAbout.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react';
22

3-
export default function SectionAbout(props){
4-
return <div className="section-about__wrapper row">
5-
<div className="col col--1 big-title pre-title">
6-
&gt;_
7-
</div>
3+
export default function SectionAbout(props){
4+
const id = props.title.toLowerCase().split(" ").join("-")
5+
const link = <a href={"#" + id} >&gt;_</a>
6+
return <div className="section-about__wrapper row" id={id}>
7+
<div className="col col--1 big-title pre-title">{link}</div>
88
<div className="col col--3 big-title">
9-
<span className="pre-title-mobile">&gt;_</span> {props.title}
9+
<span className="pre-title-mobile">{link}</span> {props.title}
1010
</div>
1111
<div className="col col--8 description">
1212
{props.children}

website/src/components/features.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const featuresList = [
1515
Scala CLI ships with all its dependencies
1616
<br/>
1717
No need to fluff with installing JVM or setting up PATH.
18+
<i>some additional setup may be required for <a href="/install#scala-js">JS</a> and <a href="/install#scala-native">Native</a></i>
1819
</p>
1920
</ImageBox>,
2021
<ImageBox image="universal_tool.svg" title="Universal tool" key="universal"
@@ -23,7 +24,7 @@ const featuresList = [
2324
If you want to use older <b>version of Scala</b> or
2425
run your code in <b>JS</b> or <b>Native</b> environments we've got you covered.
2526
<br/>
26-
<i>some additional <a href="TODO?">setup</a> may be required for JS and Native</i>
27+
<i>some additional setup may be required for <a href="/install#scala-js">JS</a> and <a href="/install#scala-native">Native</a></i>
2728
</p>
2829
<p>Switching between platforms or Scala versions is as easy as changing a parameter.</p>
2930
</ImageBox>,

website/src/scss/components/section-about.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@
2626
margin-bottom: 15px;
2727
}
2828

29-
.pre-title-mobile{
29+
.pre-title-mobile a{
3030
color: #DE3D3B;
31+
text-decoration: none;
3132

3233
@media ( min-width: 376px){
3334
display: none;
3435
}
3536
}
3637

37-
&.pre-title{
38+
&.pre-title a{
3839
text-align: right;
3940
padding-left: 20px;
4041
color: #DE3D3B;
42+
text-decoration: none;
4143

4244
@media ( max-width: 375px){
4345
display: none;

0 commit comments

Comments
 (0)