summaryrefslogtreecommitdiffstats
path: root/Documentation/doc-guide
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-07-17 17:46:42 -0400
committerJonathan Corbet <corbet@lwn.net>2017-07-23 17:51:45 -0400
commit868366aaac009fa74e5c8a452db6d6276c605e8b (patch)
treeb7de61b599e54b6b28a117feb9479af61f7df1e0 /Documentation/doc-guide
parentbba1e4cbdb5aadc937d70f04d1d07752828e4b2d (diff)
sphinx.rst: document scripts/sphinx-pre-install script
Now that we have a script to check for Sphinx dependencies, document it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/doc-guide')
-rw-r--r--Documentation/doc-guide/sphinx.rst48
1 files changed, 44 insertions, 4 deletions
diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst
index 5521213efa68..8faafb9b2d86 100644
--- a/Documentation/doc-guide/sphinx.rst
+++ b/Documentation/doc-guide/sphinx.rst
@@ -28,6 +28,9 @@ The ReST markups currently used by the Documentation/ files are meant to be
28built with ``Sphinx`` version 1.3 or upper. If you're desiring to build 28built with ``Sphinx`` version 1.3 or upper. If you're desiring to build
29PDF outputs, it is recommended to use version 1.4.6 or upper. 29PDF outputs, it is recommended to use version 1.4.6 or upper.
30 30
31There's a script that checks for the Spinx requirements. Please see
32:ref:`sphinx-pre-install` for further details.
33
31Most distributions are shipped with Sphinx, but its toolchain is fragile, 34Most distributions are shipped with Sphinx, but its toolchain is fragile,
32and it is not uncommon that upgrading it or some other Python packages 35and it is not uncommon that upgrading it or some other Python packages
33on your machine would cause the documentation build to break. 36on your machine would cause the documentation build to break.
@@ -47,13 +50,15 @@ or ``virtualenv``, depending on how your distribution packaged Python 3.
47 on the Sphinx version, it should be installed in separate, 50 on the Sphinx version, it should be installed in separate,
48 with ``pip install sphinx_rtd_theme``. 51 with ``pip install sphinx_rtd_theme``.
49 52
53 #) Some ReST pages contain math expressions. Due to the way Sphinx work,
54 those expressions are written using LaTeX notation. It needs texlive
55 installed with amdfonts and amsmath in order to evaluate them.
56
50In summary, if you want to install Sphinx version 1.4.9, you should do:: 57In summary, if you want to install Sphinx version 1.4.9, you should do::
51 58
52 $ virtualenv sphinx_1.4 59 $ virtualenv sphinx_1.4
53 $ . sphinx_1.4/bin/activate 60 $ . sphinx_1.4/bin/activate
54 (sphinx_1.4) $ pip install 'docutils==0.12' 61 (sphinx_1.4) $ pip install -r Documentation/sphinx/requirements.txt
55 (sphinx_1.4) $ pip install 'Sphinx==1.4.9'
56 (sphinx_1.4) $ pip install sphinx_rtd_theme
57 62
58After running ``. sphinx_1.4/bin/activate``, the prompt will change, 63After running ``. sphinx_1.4/bin/activate``, the prompt will change,
59in order to indicate that you're using the new environment. If you 64in order to indicate that you're using the new environment. If you
@@ -83,7 +88,42 @@ For PDF and LaTeX output, you'll also need ``XeLaTeX`` version 3.14159265.
83 88
84Depending on the distribution, you may also need to install a series of 89Depending on the distribution, you may also need to install a series of
85``texlive`` packages that provide the minimal set of functionalities 90``texlive`` packages that provide the minimal set of functionalities
86required for ``XeLaTex`` to work. 91required for ``XeLaTeX`` to work.
92
93.. _sphinx-pre-install:
94
95Checking for Sphinx dependencies
96--------------------------------
97
98There's a script that automatically check for Sphinx dependencies. If it can
99recognize your distribution, it will also give a hint about the install
100command line options for your distro::
101
102 $ ./scripts/sphinx-pre-install
103 Checking if the needed tools for Fedora release 26 (Twenty Six) are available
104 Warning: better to also install "texlive-luatex85".
105 You should run:
106
107 sudo dnf install -y texlive-luatex85
108 /usr/bin/virtualenv sphinx_1.4
109 . sphinx_1.4/bin/activate
110 pip install -r Documentation/sphinx/requirements.txt
111
112 Can't build as 1 mandatory dependency is missing at ./scripts/sphinx-pre-install line 468.
113
114By default, it checks all the requirements for both html and PDF, including
115the requirements for images, math expressions and LaTeX build, and assumes
116that a virtual Python environment will be used. The ones needed for html
117builds are assumed to be mandatory; the others to be optional.
118
119It supports two optional parameters:
120
121``--no-pdf``
122 Disable checks for PDF;
123
124``--no-virtualenv``
125 Use OS packaging for Sphinx instead of Python virtual environment.
126
87 127
88Sphinx Build 128Sphinx Build
89============ 129============