on master help sign in
docs(admin): add article 'Buildhosts' with system requirements

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commitd1892b211268d958e4134c82328ba1e6065a7fa3 authorMarkus Heiser <markus.heiser@darmarit.de> dateSat 28 Dec 2019, 01:25 (7 years ago) parentd6f2802
3 files changed+111−1
docs/admin/buildhosts.rst+103 docs/admin/index.rst+1 docs/conf.py+7−1
docs/admin/buildhosts.rstnew file+103
@@ -0,0 +1,103 @@
1+.. _buildhosts:
2+
3+==========
4+Buildhosts
5+==========
6+
7+.. sidebar:: This article needs some work
8+
9+ If you have any contribution send us your :pull:`PR <../pulls>`, see
10+ :ref:`how to contribute`.
11+
12+To get best results from build, its recommend to install additional packages
13+on build hosts.
14+
15+.. _docs build:
16+
17+Build docs
18+==========
19+
20+.. _Graphviz: https://graphviz.gitlab.io
21+.. _ImageMagick: https://www.imagemagick.org
22+.. _XeTeX: https://tug.org/xetex/
23+.. _dvisvgm: https://dvisvgm.de/
24+
25+.. sidebar:: Sphinx build needs
26+
27+ - ImageMagick_
28+ - Graphviz_
29+ - XeTeX_
30+ - dvisvgm_
31+
32+Most of the sphinx requirements are installed from :origin:`setup.py` and the
33+docs can be build from scratch with ``make docs``. For better math and image
34+processing additional packages are needed. The XeTeX_ needed not only for PDF
35+creation, its also needed for :ref:`math` when HTML output is build.
36+
37+To be able to do :ref:`sphinx:math-support` without CDNs, the math are rendered
38+as images (``sphinx.ext.imgmath`` extension). If your docs build (``make
39+docs``) shows warnings like this::
40+
41+ WARNING: dot(1) not found, for better output quality install \
42+ graphviz from http://www.graphviz.org
43+ ..
44+ WARNING: LaTeX command 'latex' cannot be run (needed for math \
45+ display), check the imgmath_latex setting
46+
47+you need to install additional packages on your build host, to get better HTML
48+output.
49+
50+.. _system requirements:
51+
52+.. tabs::
53+
54+ .. group-tab:: Ubuntu / debian
55+
56+ .. code-block:: sh
57+
58+ $ sudo apt install graphviz imagemagick texlive-xetex librsvg2-bin
59+
60+ .. group-tab:: Arch Linux
61+
62+ .. code-block:: sh
63+
64+ $ sudo pacman -S graphviz imagemagick texlive-bin extra/librsvg
65+
66+ .. group-tab:: Fedora / RHEL
67+
68+ .. code-block:: sh
69+
70+ $ sudo dnf install graphviz graphviz-gd texlive-xetex-bin librsvg2-tools
71+
72+
73+For PDF output you also need:
74+
75+.. tabs::
76+
77+ .. group-tab:: Ubuntu / debian
78+
79+ .. code:: sh
80+
81+ $ sudo apt texlive-latex-recommended texlive-extra-utils ttf-dejavu
82+
83+ .. group-tab:: Arch Linux
84+
85+ .. code:: sh
86+
87+ $ sudo pacman -S texlive-core texlive-latexextra ttf-dejavu
88+
89+ .. group-tab:: Fedora / RHEL
90+
91+ .. code:: sh
92+
93+ $ sudo dnf install \
94+ texlive-collection-fontsrecommended texlive-collection-latex \
95+ dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts
96+
97+.. _system requirements END:
98+
99+.. literalinclude:: ../conf.py
100+ :language: python
101+ :start-after: # sphinx.ext.imgmath setup
102+ :end-before: # sphinx.ext.imgmath setup END
103+
docs/admin/index.rst+1
@@ -12,3 +12,4 @@ Administrator documentation
1212 morty
1313 engines
1414 plugins
15+ buildhosts
docs/conf.py+7−1
@@ -53,6 +53,7 @@ extlinks['ctan'] = (
5353 'https://ctan.org/pkg/%s', 'CTAN: ')
5454
5555extensions = [
56+ 'sphinx.ext.imgmath',
5657 'sphinx.ext.extlinks',
5758 'sphinx.ext.viewcode',
5859 "sphinx.ext.autodoc",
@@ -79,10 +80,15 @@ issues_github_path = "asciimoo/searx"
7980# HTML -----------------------------------------------------------------
8081
8182sys.path.append(os.path.abspath('_themes'))
82−
8383html_theme_path = ['_themes']
8484html_theme = "searx"
8585
86+# sphinx.ext.imgmath setup
87+html_math_renderer = 'imgmath'
88+imgmath_image_format = 'svg'
89+imgmath_font_size = 14
90+# sphinx.ext.imgmath setup END
91+
8692html_theme_options = {"index_sidebar_logo": True}
8793html_context = {
8894 "project_links": [