Skip to content

Put OS-specific get-started instructions in tabs #2388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ scala-3-version: 3.1.2

collections:
contribute_resources:
output: false
install_tabs:
output: false
style:
output: true
overviews:
Expand Down
4 changes: 4 additions & 0 deletions _data/setup-scala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linux: curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup
macOS-default: curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-apple-darwin.gz | gzip -d > cs && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup
macOS-brew: brew install coursier/formulas/coursier && cs setup
windows-link: https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-win32.zip
37 changes: 6 additions & 31 deletions _fr/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ Nous recommandons l'utilisation de l'outil d'installation "Coursier" qui va auto
### Utilisation de l'installateur Scala (recommandé)

L'installateur Scala est un outil nommé [Coursier](https://get-coursier.io/docs/cli-overview), la commande principale de l'outil est `cs`.
Il s'assure que la JVM est les outils standards de Scala sont installés sur votre système.
Il s'assure que la JVM est les outils standards de Scala sont installés sur votre système.
Installez-le sur votre système avec les instructions suivantes.

<div class="main-download">
<div id="download-step-one">
<p>Suivez <a href="https://get-coursier.io/docs/cli-installation.html#native-launcher" target="_blank">les instructions pour installer la commande <code>cs</code></a> puis exécutez :</p>
<p><code>$ ./cs setup</code></p>
<div class="recommended-install">
<div class="place-inline">
{% include tabsection.html language='fr' id='install-cs-setup-tabs' collection=site.install_tabs %}
</div>
<!-- TODO: translate 'Test your setup' from _includes/getting-started.md, embellish tabs -->
</div>
</div>

Expand Down Expand Up @@ -165,30 +167,3 @@ Une fois que vous avez terminé le tutoriel ce dessus, vous pouvez consulter :
Il y a plusieurs listes de diffusion et canaux de discussions instantanés si vous souhaitez rencontrer rapidement d'autres utilisateurs de Scala. Allez faire un tour sur notre page [community](https://scala-lang.org/community/) pour consulter la liste des ces ressources et obtenir de l'aide.

Traduction par Antoine Pointeau.

<!-- Hidden elements whose content are used to provide OS-specific download instructions.
-- This is handled in `resources/js/functions.js`.
-->
<div style="display:none" id="stepOne-linux">
<code class="hljs">$ curl -fLo cs https://git.io/coursier-cli-linux && chmod +x cs && ./cs setup </code> <br>
</div>

<div style="display:none" id="stepOne-unix">
<p>Suivez <a href="https://get-coursier.io/docs/cli-installation" target="_blank">les instructions pour installer la commande
<code>cs</code></a>puis exécutez :</p>
<p><code>$ ./cs setup</code></p>
</div>

<div style="display:none" id="stepOne-osx">
<div class="highlight">
<code class="hljs">$ brew install coursier/formulas/coursier && cs setup </code> <br>
</div>
<p>Alternativement, si vous n'utilisez pas Homebrew</p>
<div class="highlight">
<code class="hljs">$ curl -fLo cs https://git.io/coursier-cli-macos && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup</code> <br>
</div>
</div>

<div style="display:none" id="stepOne-windows">
<p>Téléchargez et exécutez <a href="https://git.io/coursier-cli-windows-exe">l'intallateur Scala pour Windows</a> basé sur Coursier</p>
</div>
35 changes: 5 additions & 30 deletions _includes/_ja/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ Scala のインストーラーは[Coursier](https://get-coursier.io/docs/cli-ove
以下の手順でお使いのシステムにインストールしてください。

<div class="main-download">
<div id="download-step-one">
<p>Follow <a href="https://get-coursier.io/docs/cli-installation.html#native-launcher" target="_blank">the instructions to install the <code>cs</code> launcher</a> then run:</p>
<p><code>$ ./cs setup</code></p>
<div class="recommended-install">
<div class="place-inline">
{% include tabsection.html language='ja' id='install-cs-setup-tabs' collection=site.install_tabs %}
</div>
<!-- TODO: translate 'Test your setup' from _includes/getting-started.md, embellish tabs -->
</div>
</div>


`cs setup` は JVM の管理だけでなく、便利なコマンドラインツールもインストールします:

- JDK (インストール済みでなければ)
Expand Down Expand Up @@ -141,29 +142,3 @@ IDE の使用に慣れている場合は、IDE から_Main.scala_のコードを

### (日本語のみ追記)
Scala について日本語で質問したい場合、Twitterでつぶやくと気づいた人が教えてくれます。

<!-- Hidden elements whose content are used to provide OS-specific download instructions.
-- This is handled in `resources/js/functions.js`.
-->
<div style="display:none" id="stepOne-linux">
<code class="hljs">$ curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup</code> <br>
</div>

<div style="display:none" id="stepOne-unix">
<p><a href="https://get-coursier.io/docs/cli-installation" target="_blank">手順に従って <code>cs</code> ランチャーをインストール</a>し、その次に以下を実行します。</p>
<p><code>$ ./cs setup</code></p>
</div>

<div style="display:none" id="stepOne-osx">
<div class="highlight">
<code class="hljs">$ brew install coursier/formulas/coursier && cs setup </code> <br>
</div>
<p>または、Homebrewを使用しない場合は</p>
<div class="highlight">
<code class="hljs">$ curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-apple-darwin.gz | gzip -d > cs && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup</code> <br>
</div>
</div>

<div style="display:none" id="stepOne-windows">
<p><a href="https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-win32.zip">the Scala installer for Windows</a>を、ダウンロードして実行してください。</p>
</div>
6 changes: 6 additions & 0 deletions _includes/alt-details.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div {% if include.id %} id="{{include.id}}" {% endif %} class="alt-details">
<button class="alt-details-toggle">{{include.title}}</button>
<div class="alt-details-detail">
{{include.detail}}
</div>
</div>
8 changes: 8 additions & 0 deletions _includes/code-snippet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="code-snippet-area">
{% unless include.nocopy %}
<div class="code-snippet-buttons">
<button class="copy-button"><i class="far fa-clone"></i></button>
</div>
{% endunless %}
<pre class="code-snippet-display"><code class="{{include.language}}">{{include.codeSnippet}}</code></pre>
</div>
50 changes: 21 additions & 29 deletions _includes/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,29 @@ The Scala installer is a tool named [Coursier](https://get-coursier.io/docs/cli-
It ensures that a JVM and standard Scala tools are installed on your system.
Install it on your system with the following instructions.

{% capture scalaDemo %}$ scala -version
Scala code runner version {{site.scala-3-version}} -- Copyright 2002-2022, LAMP/EPFL{% endcapture %}

<div class="main-download">
<div id="download-step-one">
<p>Follow <a href="https://get-coursier.io/docs/cli-installation.html#native-launcher" target="_blank">the instructions to install the <code>cs</code> launcher</a> then run:</p>
<p><code>$ ./cs setup</code></p>
<div class="recommended-install">
<div class="place-inline">
{% include tabsection.html language='en' id='install-cs-setup-tabs' collection=site.install_tabs %}
</div>
{% capture checkSetupDetail %}
<div class="wrap-inline">
<div class="wrap">
<p>Check your setup with the command <code>scala -version</code>, which should output:</p>
{% include code-snippet.html nocopy=true language='bash' codeSnippet=scalaDemo %}
<p>If that does not work, you may need to log out and log back in (or reboot) in order for the changes to take
effect.
</p>
</div>
</div>
{% endcapture %}
<div class="place-inline">
{% include alt-details.html id='testing-your-setup' title='Testing your setup' detail=checkSetupDetail %}
</div>
</div>
</div>


Expand Down Expand Up @@ -165,29 +183,3 @@ Once you've finished the above tutorials, consider checking out:

## Getting Help
There are a multitude of mailing lists and real-time chat rooms in case you want to quickly connect with other Scala users. Check out our [community](https://scala-lang.org/community/) page for a list of these resources, and for where to reach out for help.

<!-- Hidden elements whose content are used to provide OS-specific download instructions.
-- This is handled in `resources/js/functions.js`.
-->
<div style="display:none" id="stepOne-linux">
<code class="hljs">$ curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup</code><br>
</div>

<div style="display:none" id="stepOne-unix">
<p>Follow <a href="https://get-coursier.io/docs/cli-installation" target="_blank">the instructions to install the <code>cs</code> launcher</a> then run:</p>
<p><code>$ ./cs setup</code></p>
</div>

<div style="display:none" id="stepOne-osx">
<div class="highlight">
<code class="hljs">$ brew install coursier/formulas/coursier && cs setup </code> <br>
</div>
<p>Alternatively, if you don't use Homebrew</p>
<div class="highlight">
<code class="hljs">$ curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-apple-darwin.gz | gzip -d > cs && chmod +x cs && (xattr -d com.apple.quarantine cs || true) && ./cs setup</code> <br>
</div>
</div>

<div style="display:none" id="stepOne-windows">
<p>Download and execute <a href="https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-win32.zip">the Scala installer for Windows</a> based on coursier</p>
</div>
19 changes: 19 additions & 0 deletions _includes/tabsection.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div {% if include.id %} id="{{include.id}}" {% endif %} class="tabsection">
<ul class="nav-tab">
{% for tabRoot in include.collection %}
{% if tabRoot.language == include.language %}
<li class="item-tab">
<a class="item-tab-link {% if tabRoot.defaultTab %} active{% endif %}"
data-target="{{tabRoot.tabId}}">{{tabRoot.tabLabel}}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% for tabRoot in include.collection %}
{% if tabRoot.language == include.language %}
<div class="tabcontent {% if tabRoot.defaultTab %}active{% endif %}" data-tab="{{tabRoot.tabId}}">
{{tabRoot.content}}
</div>
{% endif %}
{% endfor %}
</div>
20 changes: 20 additions & 0 deletions _install_tabs/1-macos.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
tabId: osx
tabLabel: macOS
language: en
---
<div class="wrap-inline">
<div class="wrap">
<p>Run the following command in your terminal, following the on-screen instructions:</p>
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-brew %}
{% capture homebrewDetail %}
<div class="wrap-narrow">
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-default %}
</div>
{% endcapture %}
{% include alt-details.html
title="Alternatively, if you don't use Homebrew:"
detail=homebrewDetail
%}
</div>
</div>
11 changes: 11 additions & 0 deletions _install_tabs/2-linux.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
tabId: linux
tabLabel: Linux
language: en
---
<div class="wrap-inline">
<div class="wrap">
<p>Run the following command in your terminal, following the on-screen instructions:</p>
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.linux %}
</div>
</div>
11 changes: 11 additions & 0 deletions _install_tabs/3-windows.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
tabId: windows
tabLabel: Windows
language: en
---
<div class="wrap-inline">
<div class="wrap">
<p>Download and execute <a href="{{site.data.setup-scala.windows-link}}">the Scala
installer for Windows</a> based on Coursier, and follow the on-screen instructions.</p>
</div>
</div>
15 changes: 15 additions & 0 deletions _install_tabs/4-other.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
tabId: other
tabLabel: Other
fallbackNoJS: true
language: en
---
<div class="wrap-inline">
<div class="wrap">
<noscript>
<p><span style="font-style:italic;">JavaScript is disabled, showing the default options.</span></p>
</noscript>
<p>Follow the documentation from Coursier on <a href="https://get-coursier.io/docs/cli-installation"
target="_blank">how to install and run <code>cs setup</code></a>.</p>
</div>
</div>
19 changes: 19 additions & 0 deletions _install_tabs/fr-1-macos.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
tabId: osx
tabLabel: macOS
language: fr
---
<div class="wrap-inline">
<div class="wrap">
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-brew %}
{% capture homebrewDetail %}
<div class="wrap">
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-default %}
</div>
{% endcapture %}
{% include alt-details.html
title="Alternativement, si vous n'utilisez pas Homebrew:"
detail=homebrewDetail
%}
</div>
</div>
10 changes: 10 additions & 0 deletions _install_tabs/fr-2-linux.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
tabId: linux
tabLabel: Linux
language: fr
---
<div class="wrap-inline">
<div class="wrap">
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.linux %}
</div>
</div>
10 changes: 10 additions & 0 deletions _install_tabs/fr-3-windows.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
tabId: windows
tabLabel: Windows
language: fr
---
<div class="wrap-inline">
<div class="wrap">
<p>Téléchargez et exécutez <a href="https://git.io/coursier-cli-windows-exe">l'intallateur Scala pour Windows</a> basé sur Coursier</p>
</div>
</div>
15 changes: 15 additions & 0 deletions _install_tabs/fr-4-other.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
tabId: other
tabLabel: Other
fallbackNoJS: true
language: fr
---
<div class="wrap-inline">
<div class="wrap">
<noscript>
<p><span style="font-style:italic;">JavaScript is disabled, showing the default options.</span></p>
</noscript>
<p>Suivez <a href="https://get-coursier.io/docs/cli-installation" target="_blank">les instructions pour installer la commande
<code>cs</code></a>puis exécutez <code>./cs setup</code>.</p>
</div>
</div>
19 changes: 19 additions & 0 deletions _install_tabs/ja-1-macos.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
tabId: osx
tabLabel: macOS
language: ja
---
<div class="wrap-inline">
<div class="wrap">
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-brew %}
{% capture homebrewDetail %}
<div class="wrap">
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.macOS-default %}
</div>
{% endcapture %}
{% include alt-details.html
title="または、Homebrewを使用しない場合は"
detail=homebrewDetail
%}
</div>
</div>
10 changes: 10 additions & 0 deletions _install_tabs/ja-2-linux.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
tabId: linux
tabLabel: Linux
language: ja
---
<div class="wrap-inline">
<div class="wrap">
{% include code-snippet.html language='bash' codeSnippet=site.data.setup-scala.linux %}
</div>
</div>
10 changes: 10 additions & 0 deletions _install_tabs/ja-3-windows.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
tabId: windows
tabLabel: Windows
language: ja
---
<div class="wrap-inline">
<div class="wrap">
<p><a href="https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-win32.zip">the Scala installer for Windows</a>を、ダウンロードして実行してください。</p>
</div>
</div>
14 changes: 14 additions & 0 deletions _install_tabs/ja-4-other.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
tabId: other
tabLabel: Other
fallbackNoJS: true
language: ja
---
<div class="wrap-inline">
<div class="wrap">
<noscript>
<p><span style="font-style:italic;">JavaScript is disabled, showing the default options.</span></p>
</noscript>
<p><a href="https://get-coursier.io/docs/cli-installation" target="_blank">手順に従って <code>cs</code> ランチャーをインストール</a>し、その次に以下を実行します。<code>./cs setup</code></p>
</div>
</div>
Loading