-
Notifications
You must be signed in to change notification settings - Fork 121
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
Refactor landing page and add pages for each usecase. #151
Changes from all commits
23d6102
482770e
31b58b8
a52e7cf
a2305ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
export default function Section(props){ | ||
return <div className="row"> | ||
<div className="col col--7 col--offset-1 text--left"> | ||
<div className="text--center padding--lg"/> | ||
{props.children} | ||
</div> | ||
<div className="col col--4"> | ||
{props.image ? <img src={props.image}/> : ""} | ||
</div> | ||
</div> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
export default function TitleSection(props){ | ||
return <div className="row"> | ||
<div className="install-section col col--6 col--offset-2 text--left"> | ||
{props.children} | ||
</div> | ||
<div className="install-section col col--4 text--center"> | ||
{props.right} | ||
</div> | ||
</div> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
import DownloadButton from './DownloadButton'; | ||
import BrowserOnly from '@docusaurus/BrowserOnly'; | ||
|
||
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'] | ||
|
||
function defaultOS(){ return window ? (window.navigator.userAgent.indexOf("Win") != -1 ? "win" : "mac/linux") : "mac/linux" } | ||
|
||
export default function BasicInstall(props){ | ||
return <BrowserOnly>{() => | ||
<div> | ||
<Tabs | ||
groupId="operating-systems" | ||
defaultValue={defaultOS()} | ||
values={[ | ||
{label: 'Windows', value: 'win'}, | ||
{label: 'macOS/Linux', value: 'mac/linux'}, | ||
]}> | ||
<TabItem value="win"> | ||
<a className="no_monospace" href="https://github.com/Virtuslab/scala-cli/releases/download/nightly/scala-cli-x86_64-pc-win32.msi"> | ||
Download Scala CLI for Windows | ||
</a> | ||
</TabItem> | ||
<TabItem value="mac/linux"> | ||
<p>Run the following one-line command in your terminal | ||
<br/> | ||
<code> bash | ||
curl -sSLf https://virtuslab.github.io/scala-cli-packages/scala-setup.sh | sh | ||
</code> | ||
</p> | ||
</TabItem> | ||
</Tabs> | ||
</div> | ||
}</BrowserOnly> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react'; | ||
import Link from '@docusaurus/Link'; | ||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; | ||
import Layout from '@theme/Layout'; | ||
import BasicInstall from "../components/basicInstall" | ||
|
||
const Feature = (props) => | ||
<div className="row padding--md feature-row"> | ||
<div className="col col--1"/> | ||
<div className="col col--6" key="img"> | ||
{!props.image ? "" : <div className="green_border"><img src={props.image}/></div>} | ||
</div> | ||
<div className="col col--5" key="text"> | ||
<div className="padding--md"/> | ||
<h3>{props.title}</h3> | ||
<div className="padding--sm"/> | ||
{props.children} | ||
</div> | ||
<div className="col col--1"/> | ||
</div> | ||
|
||
const FeatureList = [ | ||
<Feature image="img/envs.gif" title="Scala versions, dependencies and JVMs" | ||
key="versions" education="true" projects="true" scripting="true" prototyping="true"> | ||
<p> | ||
Scala CLI is built on top of coursier | ||
<br/> | ||
This allow us to manage Scala versions, dependencies and JVMs so you can test your code in different environments by changing single option. | ||
</p> | ||
|
||
<p> | ||
Scala CLI ships with all its dependencies | ||
<br/> | ||
No need to fluff with installing JVM or setting up PATH. | ||
</p> | ||
</Feature>, | ||
<Feature image="img/envs.gif" title="Universal tool" key="universal" | ||
projects="true" scripting="true" prototyping="true"> | ||
<p> | ||
If you want to use older <b>version of Scala</b> or | ||
run your code in <b>JS</b> or <b>Native</b> environments we've got you covered. | ||
<br/> | ||
<i>some additional <a href="TODO?">setup</a> may be required for JS and Native</i> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For scalaJs, the Node is required - https://github.com/VirtuslabRnD/scala-cli-features/issues/6 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add documentation what and how should be installed to js section in the documentation and link it here? Do we need any specific setup for native? |
||
</p> | ||
</Feature>, | ||
<Feature | ||
image="https://user-images.githubusercontent.com/1408093/68486864-dd9f2b00-01f6-11ea-9291-d3a7ce6ef225.png" | ||
title="We do not call Scala CLI a build tool" key="buildtool" projects="true"> | ||
<p> | ||
Scala CLI shares some similarities with build tools, | ||
but doesn't aim at supporting multi-module projects, | ||
nor to be extended via a task system known from sbt, mill or bazel. | ||
</p>, | ||
<p> | ||
Scala ecosystem has multiple amazing build tools, there is no need to create another one. | ||
</p> | ||
</Feature> | ||
] | ||
|
||
export default function allFeatures() { | ||
return FeatureList | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; | ||
import Layout from '@theme/Layout'; | ||
import TitleSection from '../components/TitleSection'; | ||
import Section from '../components/Section'; | ||
import allFeatures from '../components/features'; | ||
|
||
const Index = (props) => { | ||
const { siteConfig } = useDocusaurusContext(); | ||
return ( | ||
<Layout title="Education" description="Page describing why Scala CLI is good within educational purposes, mainly learning Scala."> | ||
<div className="container padding--sm content"> | ||
<TitleSection><h1>Scala CLI for Education</h1></TitleSection> | ||
|
||
<Section> | ||
<p>TODO: describe why Scala CLI is a perfect for learning Scala! Plus some image?</p> | ||
</Section> | ||
|
||
{allFeatures().filter(f => f.props.education)} | ||
</div> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have doubt it should be here 'single option', because it requires changing a few options, not just one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One option is often enough, isn't it? Like
--jvm 11
,--scala-js
, or--scala 2.13
.