Skip to content

Commit f97b622

Browse files
author
Matthias Koeppe
committed
src/doc/en/installation/index.rst: Restructure Windows section as decision tree
1 parent 2370c22 commit f97b622

File tree

1 file changed

+96
-74
lines changed

1 file changed

+96
-74
lines changed

src/doc/en/installation/index.rst

Lines changed: 96 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -58,90 +58,47 @@ macOS
5858
Windows
5959
=======
6060

61-
Approach 1: Use Visual Studio Code with SageMath dev containers
62-
---------------------------------------------------------------
63-
64-
`Visual Studio Code <https://code.visualstudio.com/>`_ is a popular
65-
and powerful code editor developed by Microsoft and made available
66-
free of charge. We recommmend it because of a key feature, the `Visual
67-
Studio Code Dev Containers extension
68-
<https://code.visualstudio.com/docs/devcontainers/containers>`_, which
69-
provides a very convenient way to install and use SageMath running in
70-
a Linux container.
71-
72-
We recommend this installation method in particular to users who are not already
73-
familiar with Windows Subsystem for Linux. It is also suitable for machines that
74-
cannot run WSL 2 (because of hardware constraints or policy set by system
75-
administrators) but can run Docker.
76-
77-
Note that although the source code of VS Code is open source (MIT
78-
License), the Dev Containers extension is only known to work with the
79-
Visual Studio Code product, but not with fully open source builds such
80-
as `VSCodium <https://vscodium.com/>`_.
61+
SageMath does not run natively on Windows. Using SageMath on this
62+
platform requires a virtualization method. Hence, as a first step:
8163

8264
- Make sure that hardware-assisted virtualization is enabled in
8365
the EFI or BIOS of your system. If in doubt, refer to your
8466
system's documentation for instructions on how to do this.
8567

86-
- `Download and install VS Code <https://code.visualstudio.com/>`_.
87-
88-
- In VS Code, if the `Visual Studio Code Dev Containers
89-
<https://code.visualstudio.com/docs/devcontainers/containers>`_ extension
90-
is not already installed, click the "Extension" icon on the left
91-
(or press :kbd:`Ctrl` + :kbd:`Shift` + :kbd:`X`) to open a list of
92-
extensions. Search for "Dev Containers" and install it.
93-
94-
The extension will walk you through the installation of Docker
95-
Desktop and activating Windows Subsystem for Linux (WSL 2).
96-
97-
**Do you want to do SageMath development?**
98-
99-
- **Yes, development:**
100-
101-
- In VS Code, `clone
102-
<https://code.visualstudio.com/docs/editor/versioncontrol#_cloning-a-repository>`_
103-
the `SageMath git repository
104-
<https://github.com/sagemath/sage>`_. For example, use the VS Code
105-
Command Palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`), enter the
106-
command "Git: Clone", hit :kbd:`Enter`, paste the URL https://github.com/sagemath/sage
107-
and hit :kbd:`Enter` again.
108-
109-
- Use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`),
110-
enter the command "Dev Containers: Reopen Folder in Container" , and hit :kbd:`Enter`.
111-
112-
By clicking on "show log", you can see what it does; it will take a while.
113-
114-
- To use Sage in a terminal, `open a new terminal in VS Code
115-
<https://code.visualstudio.com/docs/terminal/basics>`_ and type ``./sage``.
11668

117-
- **No development:**
69+
**Are you familiar with or interested in learning about using the Linux command line?**
11870

119-
- Open the folder of a project where you would like to use Sage in VS Code, or
120-
just create a new folder for your work with Sage.
71+
- **Yes, Linux command line:**
12172

122-
- Create a subfolder named ``.devcontainer``. Download this file from the
123-
SageMath GitHub repository and place it in this subfolder:
73+
Then we recommend the method described in section
74+
:ref:`installation-guide-windows-wsl` below.
12475

125-
- https://github.com/sagemath/sage/blob/develop/.devcontainer/downstream-conda-forge-latest/devcontainer.json
76+
This method is also a good choice if you are not interested in using
77+
Visual Studio Code and if you want to have a persistent Sage
78+
installation for use in several projects.
12679

127-
- Use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`),
128-
enter the command "Dev Containers: Reopen Folder in Container" , and hit :kbd:`Enter`.
80+
- **No, prefer to use Visual Studio Code:**
12981

130-
By clicking on "show log", you can see what it does; it will take a while.
82+
Then we recommend the method described in section
83+
:ref:`installation-guide-windows-devcontainers` below.
13184

132-
- To use Sage in a terminal, `open a new terminal in VS Code
133-
<https://code.visualstudio.com/docs/terminal/basics>`_ and type ``sage``.
85+
`Visual Studio Code <https://code.visualstudio.com/>`_ is a popular
86+
and powerful code editor developed by Microsoft and made available
87+
free of charge. We recommmend it because of a key feature, the `Visual
88+
Studio Code Dev Containers extension
89+
<https://code.visualstudio.com/docs/devcontainers/containers>`_, which
90+
provides a very convenient way to install and use SageMath running in
91+
a Linux container.
13492

135-
To use Sage in a Jupyter notebook, click the "Extension" icon on the left (or press
136-
:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`X`) to open a list of
137-
extensions. Install the "Jupyter" extension. In the command
138-
palette, enter "Create: New Jupyter Notebook", and hit
139-
:kbd:`Enter`. Click "Select Kernel" on the right (or press :kbd:`Ctrl` +
140-
:kbd:`Alt` + :kbd:`Enter`), select SageMath, and hit :kbd:`Enter`.
93+
We recommend this installation method in particular to users who are not already
94+
familiar with Windows Subsystem for Linux. It is also suitable for machines that
95+
cannot run WSL 2 (because of hardware constraints or policy set by system
96+
administrators) but can run Docker.
14197

98+
.. _installation-guide-windows-wsl:
14299

143-
Approach 2: Manual installation using Windows Subsystem for Linux
144-
-----------------------------------------------------------------
100+
Installing SageMath in the Windows Subsystem for Linux
101+
------------------------------------------------------
145102

146103
We recommend this installation method in particular to users who are already
147104
familiar with Linux or Windows Subsystem for Linux. It is also a good choice if
@@ -151,10 +108,6 @@ Enable `Windows Subsystem for Linux (WSL)
151108
<https://learn.microsoft.com/en-us/windows/wsl/>`_ and install
152109
Ubuntu as follows.
153110

154-
- Make sure that hardware-assisted virtualization is enabled in
155-
the EFI or BIOS of your system. If in doubt, refer to your
156-
system's documentation for instructions on how to do this.
157-
158111
- `Run the WSL install command as administrator.
159112
<https://learn.microsoft.com/en-us/windows/wsl/setup/environment#get-started>`_
160113
This will install Ubuntu Linux.
@@ -181,7 +134,7 @@ Start Ubuntu from the Start menu.
181134

182135
- **Yes, development:**
183136

184-
Then follow the instructions for development on Linux below.
137+
Then follow the :ref:`instructions for development on Linux <installation-guide-linux>` below.
185138

186139
- **No development:**
187140

@@ -208,6 +161,75 @@ To use Sage in a Jupyter notebook, it is convenient to use Visual Studio Code.
208161
See :ref:`sec-launching-vscode-wsl`.
209162

210163

164+
.. _installation-guide-windows-devcontainers:
165+
166+
Using Visual Studio Code with SageMath dev containers
167+
-----------------------------------------------------
168+
169+
- `Download and install VS Code <https://code.visualstudio.com/>`_.
170+
171+
.. note::
172+
173+
Although the source code of VS Code is open source (MIT
174+
License), the Dev Containers extension is only known to work with the
175+
Visual Studio Code product, but not with fully open source builds such
176+
as `VSCodium <https://vscodium.com/>`_.
177+
178+
- In VS Code, if the `Visual Studio Code Dev Containers
179+
<https://code.visualstudio.com/docs/devcontainers/containers>`_ extension
180+
is not already installed, click the "Extension" icon on the left
181+
(or press :kbd:`Ctrl` + :kbd:`Shift` + :kbd:`X`) to open a list of
182+
extensions. Search for "Dev Containers" and install it.
183+
184+
The extension will walk you through the installation of Docker
185+
Desktop and activating Windows Subsystem for Linux (WSL 2).
186+
187+
**Do you want to do SageMath development?**
188+
189+
- **Yes, development:**
190+
191+
- In VS Code, `clone
192+
<https://code.visualstudio.com/docs/editor/versioncontrol#_cloning-a-repository>`_
193+
the `SageMath git repository
194+
<https://github.com/sagemath/sage>`_. For example, use the VS Code
195+
Command Palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`), enter the
196+
command "Git: Clone", hit :kbd:`Enter`, paste the URL https://github.com/sagemath/sage
197+
and hit :kbd:`Enter` again.
198+
199+
- Use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`),
200+
enter the command "Dev Containers: Reopen Folder in Container" , and hit :kbd:`Enter`.
201+
202+
By clicking on "show log", you can see what it does; it will take a while.
203+
204+
- To use Sage in a terminal, `open a new terminal in VS Code
205+
<https://code.visualstudio.com/docs/terminal/basics>`_ and type ``./sage``.
206+
207+
- **No development:**
208+
209+
- Open the folder of a project where you would like to use Sage in VS Code, or
210+
just create a new folder for your work with Sage.
211+
212+
- Create a subfolder named ``.devcontainer``. Download this file from the
213+
SageMath GitHub repository and place it in this subfolder:
214+
215+
- https://github.com/sagemath/sage/blob/develop/.devcontainer/downstream-conda-forge-latest/devcontainer.json
216+
217+
- Use the command palette (:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`P`),
218+
enter the command "Dev Containers: Reopen Folder in Container" , and hit :kbd:`Enter`.
219+
220+
By clicking on "show log", you can see what it does; it will take a while.
221+
222+
- To use Sage in a terminal, `open a new terminal in VS Code
223+
<https://code.visualstudio.com/docs/terminal/basics>`_ and type ``sage``.
224+
225+
To use Sage in a Jupyter notebook, click the "Extension" icon on the left (or press
226+
:kbd:`Ctrl` + :kbd:`Shift` + :kbd:`X`) to open a list of
227+
extensions. Install the "Jupyter" extension. In the command
228+
palette, enter "Create: New Jupyter Notebook", and hit
229+
:kbd:`Enter`. Click "Select Kernel" on the right (or press :kbd:`Ctrl` +
230+
:kbd:`Alt` + :kbd:`Enter`), select SageMath, and hit :kbd:`Enter`.
231+
232+
211233
.. _installation-guide-linux:
212234

213235
Linux

0 commit comments

Comments
 (0)