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/components/account/config/editor/jupyter.tsx
Views: 687
import register from "../register";1import { Space } from "antd";2import Loading from "components/share/loading";3import A from "components/misc/A";4import useEditTable from "lib/hooks/edit-table";5import { JUPYTER_CLASSIC_MODERN } from "@cocalc/util/theme";67const desc = {8jupyter_line_numbers: `Display line numbers to the left of input cells in Jupyter notebooks.`,9ask_jupyter_kernel: `Each time you create a new Jupyter notebook, by default it will ask which kernel to use.10If you disable this option, then new notebooks will open using the kernel that you most recently explicitly11selected. You can of course change the kernel of any notebook at any time in the Kernel dropdown menu.`,12disable_jupyter_virtualization: `By default Jupyter notebooks are rendered using "virtualization" or "windowing", so only the visible cells are actually rendered. If you select this option, then we instead render entire notebook. This is potentially much slower but may address some subtle issues. You must close and open your notebook to see the change.`,13jupyter_classic: `CoCalc includes a mode where it embeds14the classical Jupyter notebook in an iframe and installs a plugin to enable realtime collaboration.15However, collaboration does not work as well as in the default Jupyter editor.`,16};1718interface Data {19editor_settings: {20ask_jupyter_kernel?: boolean;21jupyter_line_numbers?: boolean;22disable_jupyter_virtualization?: boolean;23jupyter_classic?: boolean;24};25}2627register({28path: "editor/jupyter",29title: "Jupyter Notebooks",30icon: "ipynb",31desc: "Configuration options specific to Jupyter notebooks, e.g., line numbers for input cells or asking for the kernel for new notebooks.",32search: desc,33Component: () => {34const { edited, original, Save, EditBoolean } = useEditTable<Data>({35accounts: { editor_settings: null },36});3738if (original == null || edited == null) {39return <Loading />;40}4142return (43<Space direction="vertical" size="large">44<Save />45<EditBoolean46icon="list-ol"47path="editor_settings.jupyter_line_numbers"48title="Line Numbers"49desc={desc.jupyter_line_numbers}50label="Line numbers"51/>52<EditBoolean53icon="question-circle"54path="editor_settings.ask_jupyter_kernel"55title="New Notebook Kernel"56desc={desc.ask_jupyter_kernel}57label="Ask which kernel to use"58/>59<EditBoolean60icon="list"61path="editor_settings.disable_jupyter_virtualization"62title="Disable Jupyter Virtualization"63desc={desc.disable_jupyter_virtualization}64label={65<>66No virtualization -- render entire notebook rather than rendering67just the visible part of it using{" "}68<A href="https://virtuoso.dev/">react-virtuoso</A>.69</>70}71/>72<EditBoolean73icon="ipynb"74path="editor_settings.jupyter_classic"75title="Jupyter Classic"76desc={77<>78{desc.jupyter_classic}{" "}79<A href={JUPYTER_CLASSIC_MODERN}>80(DANGER: this can cause trouble...)81</A>{" "}82You can also{" "}83<A href="https://doc.cocalc.com/jupyter.html#alternatives-plain-jupyter-server-and-jupyterlab-server">84very easily use a standard JupyterLab or Jupyter classic server85</A>{" "}86from any CoCalc project, without changing this setting.87</>88}89label="Use Jupyter classic"90/>91</Space>92);93},94});959697