CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

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