summaryrefslogtreecommitdiff
path: root/doc/usage/installation.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/usage/installation.rst')
-rw-r--r--doc/usage/installation.rst55
1 files changed, 46 insertions, 9 deletions
diff --git a/doc/usage/installation.rst b/doc/usage/installation.rst
index f0384ea9d..8cf56b501 100644
--- a/doc/usage/installation.rst
+++ b/doc/usage/installation.rst
@@ -185,30 +185,67 @@ the ``--pre`` flag.
$ pip install -U --pre sphinx
+Using virtual environments
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When installing Sphinx using pip,
+it is highly recommended to use *virtual environments*,
+which isolate the installed packages from the system packages,
+thus removing the need to use administrator privileges.
+To create a virtual environment in the ``.venv`` directory,
+use the following command.
+
+::
+
+ $ python -m venv .venv
+
+You can read more about them in the `Python Packaging User Guide`_.
+
+.. _Python Packaging User Guide: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
+
+.. warning::
+
+ Note that in some Linux distributions, such as Debian and Ubuntu,
+ this might require an extra installation step as follows.
+
+ .. code-block:: console
+
+ $ apt-get install python3-venv
Docker
------
-Docker images for Sphinx are published on the `Docker Hub <https://hub.docker.com/>`_. There are two kind of images:
+Docker images for Sphinx are published on the `Docker Hub`_. There are two kind
+of images:
-- `sphinxdoc/sphinx <https://hub.docker.com/repository/docker/sphinxdoc/sphinx>`_
-- `sphinxdoc/sphinx-latexpdf <https://hub.docker.com/repository/docker/sphinxdoc/sphinx-latexpdf>`_
+- `sphinxdoc/sphinx`_
+- `sphinxdoc/sphinx-latexpdf`_
-Former one is used for standard usage of Sphinx, and latter one is mainly used for PDF builds using LaTeX.
-Please choose one for your purpose.
+.. _Docker Hub: https://hub.docker.com/
+.. _sphinxdoc/sphinx: https://hub.docker.com/repository/docker/sphinxdoc/sphinx
+.. _sphinxdoc/sphinx-latexpdf: https://hub.docker.com/repository/docker/sphinxdoc/sphinx-latexpdf>
+
+Former one is used for standard usage of Sphinx, and latter one is mainly used for
+PDF builds using LaTeX. Please choose one for your purpose.
.. note::
- sphinxdoc/sphinx-latexpdf contains TeXLive packages. So the image is very large (over 2GB!).
+ sphinxdoc/sphinx-latexpdf contains TeXLive packages. So the image is very large
+ (over 2GB!).
.. hint::
- When using docker images, please use ``docker run`` command to invoke sphinx commands. For example,
- you can use following command to create a Sphinx project::
+ When using docker images, please use ``docker run`` command to invoke sphinx
+ commands. For example, you can use following command to create a Sphinx
+ project:
+
+ .. code-block:: bash
$ docker run -it --rm -v /path/to/document:/docs sphinxdoc/sphinx sphinx-quickstart
- And you can following command this to build HTML document::
+ And you can following command this to build HTML document:
+
+ .. code-block:: bash
$ docker run --rm -v /path/to/document:/docs sphinxdoc/sphinx make html