Path: blob/master/src/packages/next/pages/software/index.tsx
1450 views
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Button, Layout, Space } from "antd";67import {8LanguageName,9SOFTWARE_ENV_DEFAULT,10SOFTWARE_ENV_NAMES,11} from "@cocalc/util/consts/software-envs";12import Footer from "components/landing/footer";13import Head from "components/landing/head";14import Header from "components/landing/header";15import IndexList, { DataSource } from "components/landing/index-list";16import { Paragraph } from "components/misc";17import A from "components/misc/A";18import { MAX_WIDTH } from "lib/config";19import { Customize } from "lib/customize";20import withCustomize from "lib/with-customize";21import juliaLogo from "public/features/julia-logo.svg";22import sageScreenshot from "public/features/sage-worksheet.png";23import executablesScreenshot from "public/software/executables.png";24import octaveJupyter from "/public/features/cocalc-octave-jupyter-20200511.png";25import RJupyter from "/public/features/cocalc-r-jupyter.png";26import pythonScreenshot from "/public/features/frame-editor-python.png";27import octaveLogo from "/public/features/octave-logo.svg";28import PythonLogo from "/public/features/python-logo.svg";29import Rlogo from "/public/features/r-logo.svg";30import sageLogo from "/public/features/sage-sticker-1x1_inch-small.png";31import JuliaJupyter from "/public/software/julia-jupyter.png";3233export const STYLE_PAGE: React.CSSProperties = {34maxWidth: MAX_WIDTH,35margin: "0 auto",36padding: "40px 15px 0 15px",37backgroundColor: "white",38} as const;3940// STYLE_PAGE should have a max width of 1200px41export const STYLE_PAGE_WIDE: React.CSSProperties = {42...STYLE_PAGE,43maxWidth: "1200px",44} as const;4546const LINKS: { [lang in LanguageName | "executables"]: string } = {47executables: `/software/executables/${SOFTWARE_ENV_DEFAULT}`,48python: `/software/python/${SOFTWARE_ENV_DEFAULT}`,49R: `/software/r/${SOFTWARE_ENV_DEFAULT}`,50julia: `/software/julia/${SOFTWARE_ENV_DEFAULT}`,51octave: `/software/octave/${SOFTWARE_ENV_DEFAULT}`,52sagemath: `/software/sagemath/${SOFTWARE_ENV_DEFAULT}`,53} as const;5455function renderSoftwareEnvLinks(lang: LanguageName | "executables") {56return (57<Paragraph>58<Space>59{SOFTWARE_ENV_NAMES.map((name) => {60const type = SOFTWARE_ENV_DEFAULT === name ? "primary" : undefined;61const style = type === "primary" ? { fontWeight: "bold" } : {};62// toLowerCase is necessary for R → r63const href = `/software/${lang.toLowerCase()}/${name}`;64return (65<Button66size="small"67type={type}68href={href}69style={{ ...style, padding: "5px" }}70>71{name}72</Button>73);74})}75</Space>76</Paragraph>77);78}7980const dataSource: DataSource = [81{82link: LINKS.executables,83title: "Executables",84logo: "laptop",85image: executablesScreenshot,86description: (87<>88<Paragraph>89CoCalc comes pre-installed with{" "}90<A href={LINKS.executables}>thousands of programs</A> that you can run91from the terminal or in an X11 environment, or call from your92notebooks or scripts.93</Paragraph>94{renderSoftwareEnvLinks("executables")}95</>96),97},98{99link: LINKS.python,100title: "Python Libraries",101logo: PythonLogo,102logoBackground: "white",103image: pythonScreenshot,104description: (105<>106<Paragraph>107CoCalc offers a large number of{" "}108<A href={LINKS.python}>Python libraries preinstalled</A> system wide,109in Anaconda, and in several versions of Sage.110</Paragraph>111{renderSoftwareEnvLinks("python")}112</>113),114},115{116link: LINKS.sagemath,117title: "SageMath Packages",118logo: sageLogo,119logoBackground: "white",120image: sageScreenshot,121description: (122<>123<Paragraph>124CoCalc provides <A href={LINKS.sagemath}>SageMath environments</A>{" "}125with additional preinstalled packages.126</Paragraph>127{renderSoftwareEnvLinks("sagemath")}128</>129),130},131{132link: LINKS.R,133title: "R Statistical Software Packages",134logo: Rlogo,135logoBackground: "white",136image: RJupyter,137description: (138<>139<Paragraph>140CoCalc maintains an extensive set of <A href={LINKS.R}>R packages</A>141</Paragraph>142{renderSoftwareEnvLinks("R")}143</>144),145},146{147link: LINKS.julia,148title: "Julia Packages",149logo: juliaLogo,150logoBackground: "white",151image: JuliaJupyter,152description: (153<>154<Paragraph>155CoCalc regularly updates Julia and installs{" "}156<A href={LINKS.julia}>many common Julia packages</A>.157</Paragraph>158{renderSoftwareEnvLinks("julia")}159</>160),161},162{163link: LINKS.octave,164title: "Octave Packages",165logo: octaveLogo,166logoBackground: "white",167image: octaveJupyter,168description: (169<>170<Paragraph>171There are several <A href={LINKS.octave}>Octave packages</A> that are172preinstalled.173</Paragraph>174{renderSoftwareEnvLinks("octave")}175</>176),177},178];179180export default function Software({ customize }) {181const description = (182<>183<p>These pages contain information about available software on CoCalc.</p>184<p>185By default, projects are running in an environment based on{" "}186<A href="https://en.wikipedia.org/wiki/Ubuntu">187Ubuntu {SOFTWARE_ENV_DEFAULT}188</A>189, but there are also {SOFTWARE_ENV_NAMES.length - 1} other variants190available. The default variant is actively maintained and regularly191updated – others are for testing or are deprected. The reason to pick an192older environment is backwards compatibility with older software,193running an older project of yours, or for historic purposes.194</p>195</>196);197198return (199<Customize value={customize}>200<Head title="Software" />201<Layout>202<Header page="software" />203<IndexList204title="Available Software"205description={description}206dataSource={dataSource}207/>208<Footer />209</Layout>210</Customize>211);212}213214export async function getServerSideProps(context) {215return await withCustomize({ context });216}217218219