Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/pages/software/index.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Button, Layout } 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{SOFTWARE_ENV_NAMES.map((name) => {59const type = SOFTWARE_ENV_DEFAULT === name ? "primary" : undefined;60const style =61SOFTWARE_ENV_DEFAULT === name ? { color: "white" } : undefined;62// toLowerCase is necessary for R → r63const href = `/software/${lang.toLowerCase()}/${name}`;64return (65<Button66size="small"67type={type}68style={{ ...style, marginRight: "10px" }}69href={href}70>71{name}72</Button>73);74})}75</Paragraph>76);77}7879const dataSource: DataSource = [80{81link: LINKS.executables,82title: "Executables",83logo: "laptop",84image: executablesScreenshot,85description: (86<>87<Paragraph>88CoCalc comes pre-installed with{" "}89<A href={LINKS.executables}>thousands of programs</A> that you can run90from the terminal or in an X11 environment, or call from your91notebooks or scripts.92</Paragraph>93{renderSoftwareEnvLinks("executables")}94</>95),96},97{98link: LINKS.python,99title: "Python Libraries",100logo: PythonLogo,101logoBackground: "white",102image: pythonScreenshot,103description: (104<>105<Paragraph>106CoCalc offers a large number of{" "}107<A href={LINKS.python}>Python libraries preinstalled</A> system wide,108in Anaconda, and in several versions of Sage.109</Paragraph>110{renderSoftwareEnvLinks("python")}111</>112),113},114{115link: LINKS.sagemath,116title: "SageMath Packages",117logo: sageLogo,118logoBackground: "white",119image: sageScreenshot,120description: (121<>122<Paragraph>123CoCalc provides <A href={LINKS.sagemath}>SageMath environments</A>{" "}124with additional preinstalled packages.125</Paragraph>126{renderSoftwareEnvLinks("sagemath")}127</>128),129},130{131link: LINKS.R,132title: "R Statistical Software Packages",133logo: Rlogo,134logoBackground: "white",135image: RJupyter,136description: (137<>138<Paragraph>139CoCalc maintains an extensive set of <A href={LINKS.R}>R packages</A>140</Paragraph>141{renderSoftwareEnvLinks("R")}142</>143),144},145{146link: LINKS.julia,147title: "Julia Packages",148logo: juliaLogo,149logoBackground: "white",150image: JuliaJupyter,151description: (152<>153<Paragraph>154CoCalc regularly updates Julia and installs{" "}155<A href={LINKS.julia}>many common Julia packages</A>.156</Paragraph>157{renderSoftwareEnvLinks("julia")}158</>159),160},161{162link: LINKS.octave,163title: "Octave Packages",164logo: octaveLogo,165logoBackground: "white",166image: octaveJupyter,167description: (168<>169<Paragraph>170There are several <A href={LINKS.octave}>Octave packages</A> that are171preinstalled.172</Paragraph>173{renderSoftwareEnvLinks("octave")}174</>175),176},177];178179export default function Software({ customize }) {180const description = (181<>182<p>These pages contain information about available software on CoCalc.</p>183<p>184By default, projects are running in an environment based on{" "}185<A href="https://en.wikipedia.org/wiki/Ubuntu">186Ubuntu {SOFTWARE_ENV_DEFAULT}187</A>188, but there are also {SOFTWARE_ENV_NAMES.length - 1} older variants189available. Only the newest variant is actively maintained and regularly190updated. The older ones are deprected and contain older software for191backwards compatibility and historic purposes.192</p>193</>194);195196return (197<Customize value={customize}>198<Head title="Software" />199<Layout>200<Header page="software" />201<IndexList202title="Available Software"203description={description}204dataSource={dataSource}205/>206<Footer />207</Layout>208</Customize>209);210}211212export async function getServerSideProps(context) {213return await withCustomize({ context });214}215216217