5
5
Getting started
6
6
===============
7
7
8
+ .. raw :: html
9
+
10
+ <script >
11
+ document .addEventListener (' DOMContentLoaded' , function () {
12
+ activateTab (getOS ());
13
+ });
14
+ </script >
15
+
8
16
.. highlight :: rest
9
17
10
18
The Python language has a substantial body of documentation, much of it
@@ -81,22 +89,24 @@ Create a virtual environment
81
89
----------------------------
82
90
83
91
.. _doc-create-venv-unix :
92
+ .. _doc-create-venv-windows :
84
93
85
- **On Unix platforms ** that support :program: `make `
86
- (including Linux, macOS and BSD),
87
- you can create a new :mod: `venv ` with the required dependencies using::
94
+ You can create a new :mod: `venv ` with the required dependencies using:
88
95
89
- make venv
96
+ .. tab :: Unix/macOS
90
97
91
- Building the docs with :program: `make ` will automatically use this environment
92
- without you having to activate it.
98
+ .. code-block :: shell
93
99
94
- .. _doc-create-venv-windows :
100
+ make venv
101
+
102
+ Building the docs with :program: `make ` will automatically use this environment
103
+ without you having to activate it.
104
+
105
+ .. tab :: Windows
95
106
96
- **On Windows **, or if not using :program: `make `,
97
- `create a new virtual environment <venv-create _>`__ manually.
98
- Always be sure to `activate this environment <venv-activate _>`__
99
- before building the documentation.
107
+ `Create a new virtual environment <venv-create _>`__ manually.
108
+ Always be sure to `activate this environment <venv-activate _>`__
109
+ before building the documentation.
100
110
101
111
102
112
.. _building-using-make :
@@ -106,21 +116,36 @@ before building the documentation.
106
116
Build using make / make.bat
107
117
---------------------------
108
118
109
- A Unix ``Makefile `` is provided, :cpy-file: `Doc/Makefile `,
110
- along with a :cpy-file: `Doc/make.bat ` batch file for Windows
111
- that attempts to emulate it as closely as practical.
119
+ .. tab :: Unix/macOS
120
+
121
+ A Unix ``Makefile `` is provided, :cpy-file: `Doc/Makefile `.
122
+
123
+ .. tab :: Windows
124
+
125
+ A Windows ``make.bat `` is provided, :cpy-file: `Doc/make.bat `, which
126
+ attempts to emulate the Unix ``Makefile `` as closely as practical.
127
+
128
+ .. important ::
129
+
130
+ The Windows ``make.bat `` batch file lacks a ``make venv `` target.
131
+ Instead, it automatically installs any missing dependencies
132
+ into the currently activated environment (or the base Python, if none).
133
+ Make sure the environment you :ref: `created above <doc-create-venv-windows >`
134
+ is `activated <venv-activate _>`__ before running ``make.bat ``.
135
+
136
+ To build the docs as HTML, run:
112
137
113
- .. important ::
138
+ .. tab :: Unix/macOS
114
139
115
- The Windows ``make.bat `` batch file lacks a ``make venv `` target.
116
- Instead, it automatically installs any missing dependencies
117
- into the currently activated environment (or the base Python, if none).
118
- Make sure the environment you :ref: `created above <doc-create-venv-windows >`
119
- is `activated <venv-activate _>`__ before running ``make.bat ``.
140
+ .. code-block :: shell
120
141
121
- To build the docs as HTML, run::
142
+ make html
122
143
123
- make html
144
+ .. tab :: Windows
145
+
146
+ .. code-block :: dosbatch
147
+
148
+ .\make html
124
149
125
150
.. tip :: * Replace ``html`` with ``htmlview`` to open the docs in a web browser
126
151
once the build completes.
@@ -129,13 +154,33 @@ To build the docs as HTML, run::
129
154
browser when you make changes to reST files (Unix only).
130
155
131
156
To check the docs for common errors with `Sphinx Lint `_
132
- (which is run on all :ref: `pull requests <pullrequest >`), use::
157
+ (which is run on all :ref: `pull requests <pullrequest >`), use:
158
+
159
+ .. tab :: Unix/macOS
160
+
161
+ .. code-block :: shell
162
+
163
+ make check
164
+
165
+ .. tab :: Windows
166
+
167
+ .. code-block :: dosbatch
168
+
169
+ .\make check
170
+
171
+ To list other supported :program: `make ` targets, run:
172
+
173
+ .. tab :: Unix/macOS
174
+
175
+ .. code-block :: shell
176
+
177
+ make help
133
178
134
- make check
179
+ .. tab :: Windows
135
180
136
- To list other supported :program: ` make ` targets, run::
181
+ .. code-block :: dosbatch
137
182
138
- make help
183
+ .\ make help
139
184
140
185
See :cpy-file: `Doc/README.rst ` for more information.
141
186
0 commit comments