on master help sign in
gh-pages: updated
commit56d2b50d2e04d6b8f3ab74544a3d3987bb5fa4df authorMarkus Heiser <markus.heiser@darmarit.de> dateMon 30 Dec 2019, 18:31 (7 years ago) parent32fa4c0
136 files changed+18610−11944
404.html+1 _downloads/ad0ebe55d6b53b1559e0ca8dee6f30b9/reST.rst+1428 _images/DOT-57a4a7f78690d0b6b884bc59f36e84cfb0b61f76.dot+3 _images/DOT-57a4a7f78690d0b6b884bc59f36e84cfb0b61f76.svg+31 _images/SVG-1fb7029fa2cc454a267bae271cccb2c591387416.svg+13 _images/arch_public.dot+33 _images/arch_public.svg+156 _images/hello.dot+3 _images/hello.svg+30 _images/math/07c9ff4251510b06013159f4e45ec9ab97044096.svg+25 _images/math/3b8127a8eed95247f9249ea6c85e8e86df1baa82.svg+25 _images/math/6673b43f9fe29455c1fcd1164e5844698cc64d38.svg+22 _images/math/a6a994cb6e7278ec30eaebe7e636046d3deccb5b.svg+43 _images/svg_image.svg+10 _sources/admin/api.rst.txt+96 _sources/admin/api.txt−94 _sources/admin/architecture.rst.txt+24 _sources/admin/buildhosts.rst.txt+103 _sources/admin/engines.rst.txt+68 _sources/admin/filtron.rst.txt+148 _sources/admin/filtron.txt−114 _sources/admin/index.rst.txt+15 docs/dev/install/installation.rst → _sources/admin/installation.rst.txt+84−72 _sources/admin/morty.rst.txt+26 _sources/admin/plugins.rst.txt+39 _sources/blog/admin.rst.txt+43 _sources/blog/blog.txt−7 docs/blog/blog.rst → _sources/blog/index.rst.txt+1 _sources/blog/intro-offline.rst.txt+77 _sources/blog/python3.rst.txt+68 _sources/blog/python3.txt−54 _sources/dev/contribution_guide.rst.txt+180 _sources/dev/contribution_guide.txt−98 _sources/dev/engine_overview.rst.txt+267 _sources/dev/engine_overview.txt−313 _sources/dev/index.rst.txt+15 _sources/dev/install/installation.txt−323 _sources/dev/makefile.rst.txt+221 _sources/dev/plugins.rst.txt+54 _sources/dev/plugins.txt−45 _sources/dev/quickstart.rst.txt+132 _sources/dev/quickstart.txt−108 _sources/dev/reST.rst.txt+1428 _sources/dev/search_api.rst.txt+119 _sources/dev/search_api.txt−35 _sources/dev/translation.txt → _sources/dev/translation.rst.txt+27−17 _sources/index.rst.txt+32 _sources/index.txt−55 _sources/user/index.rst.txt+9 _sources/user/own-instance.rst.txt+77 _sources/user/own-instance.txt−43 _sources/user/search_syntax.rst.txt+42 _sources/user/search_syntax.txt−33 _static/ajax-loader.gif _static/basic.css+133−4 _static/comment-bright.png _static/comment-close.png _static/comment.png _static/doctools.js+46−19 _static/documentation_options.js+11 _static/down-pressed.png _static/down.png _static/jquery-1.11.1.js → _static/jquery-3.4.1.js+5050−4760 _static/jquery.js+2−4 _static/language_data.js+297 _static/pocoo.css+483 _static/pygments.css+69−61 _static/searchtools.js+76−328 _static/searx.css+130 docs/static/img/searx_logo_small.png → _static/searx_logo_small.png _static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css+1 _static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css+9 _static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css+9 _static/sphinx_tabs/semantic-ui-2.4.1/tab.min.js+1 _static/sphinx_tabs/tabs.css+44 _static/sphinx_tabs/tabs.js+94 _static/style.css−443 _static/up-pressed.png _static/up.png _static/version_warning_offset.js+40 _static/websupport.js−808 admin/api.html+115−84 admin/architecture.html+119 admin/buildhosts.html+223 admin/engines.html+1441 admin/filtron.html+181−116 admin/index.html+114 admin/installation.html+393 admin/morty.html+83−48 admin/plugins.html+186 blog/admin.html+95−56 blog/blog.html−80 blog/index.html+109 blog/intro-offline.html+84−44 blog/python3.html+101−57 dev/contribution_guide.html+185−93 dev/engine_overview.html+402−363 dev/index.html+114 dev/install/installation.html−351 dev/makefile.html+285 dev/plugins.html+86−47 dev/quickstart.html+136−85 dev/reST.html+1620 dev/search_api.html+154−148 dev/translation.html+97−62 docs/_themes/searx_theme/layout.html−20 docs/_themes/searx_theme/relations.html−14 docs/_themes/searx_theme/static/style.css_t−443 docs/_themes/searx_theme/theme.conf−7 docs/admin/api.rst−94 docs/admin/filtron.rst−114 docs/admin/morty.rst−21 docs/blog/admin.rst−42 docs/blog/intro-offline.rst−65 docs/blog/python3.rst−54 docs/blog/searx-admin-engines.png docs/blog/searxpy3.png docs/conf.py−358 docs/dev/contribution_guide.rst−98 docs/dev/engine_overview.rst−315 docs/dev/plugins.rst−45 docs/dev/quickstart.rst−108 docs/dev/search_api.rst−204 docs/dev/translation.rst−61 docs/index.rst−56 docs/user/own-instance.rst−43 docs/user/search_syntax.rst−33 genindex.html+87−38 index.html+110−82 objects.inv requirements.txt−1 search.html+54−43 searchindex.js+1−1 user/index.html+108 user/own-instance.html+116−54 user/search_syntax.html+98−58
404.htmlnew file+1
@@ -0,0 +1 @@
1+<html><head><META http-equiv='refresh' content='0;URL=index.html'></head></html>
_downloads/ad0ebe55d6b53b1559e0ca8dee6f30b9/reST.rstnew file+1428
@@ -0,0 +1,1428 @@
1+.. _reST primer:
2+
3+===========
4+reST primer
5+===========
6+
7+.. sidebar:: KISS_ and readability_
8+
9+ Instead of defining more and more roles, we at searx encourage our
10+ contributors to follow principles like KISS_ and readability_.
11+
12+We at searx are using reStructuredText (aka reST_) markup for all kind of
13+documentation, with the builders from the Sphinx_ project a HTML output is
14+generated and deployed at :docs:`github.io <.>`. For build prerequisites read
15+:ref:`docs build`.
16+
17+The source files of Searx's documentation are located at :origin:`docs`. Sphinx
18+assumes source files to be encoded in UTF-8 by defaul. Run :ref:`make docs-live
19+<make docs-live>` to build HTML while editing.
20+
21+.. sidebar:: Further reading
22+
23+ - Sphinx-Primer_
24+ - `Sphinx markup constructs`_
25+ - reST_, docutils_, `docutils FAQ`_
26+ - Sphinx_, `sphinx-doc FAQ`_
27+ - `sphinx config`_, doctree_
28+ - `sphinx cross references`_
29+ - linuxdoc_
30+ - intersphinx_
31+ - sphinx-jinja_
32+ - `Sphinx's autodoc`_
33+ - `Sphinx's Python domain`_, `Sphinx's C domain`_
34+ - SVG_, ImageMagick_
35+ - DOT_, `Graphviz's dot`_, Graphviz_
36+
37+
38+.. contents:: Contents
39+ :depth: 3
40+ :local:
41+ :backlinks: entry
42+
43+Sphinx_ and reST_ have their place in the python ecosystem. Over that reST is
44+used in popular projects, e.g the Linux kernel documentation `[kernel doc]`_.
45+
46+.. _[kernel doc]: https://www.kernel.org/doc/html/latest/doc-guide/sphinx.html
47+
48+.. sidebar:: Content matters
49+
50+ The readability_ of the reST sources has its value, therefore we recommend to
51+ make sparse usage of reST markup / .. content matters!
52+
53+**reST** is a plaintext markup language, its markup is *mostly* intuitive and
54+you will not need to learn much to produce well formed articles with. I use the
55+word *mostly*: like everything in live, reST has its advantages and
56+disadvantages, some markups feel a bit grumpy (especially if you are used to
57+other plaintext markups).
58+
59+Soft skills
60+===========
61+
62+Before going any deeper into the markup let's face on some **soft skills** a
63+trained author brings with, to reach a well feedback from readers:
64+
65+- Documentation is dedicated to an audience and answers questions from the
66+ audience point of view.
67+- Don't detail things which are general knowledge from the audience point of
68+ view.
69+- Limit the subject, use cross links for any further reading.
70+
71+To be more concrete what a *point of view* means. In the (:origin:`docs`)
72+folder we have three sections (and the *blog* folder), each dedicate to a
73+different group of audience.
74+
75+User's POV: :origin:`docs/user`
76+ A typical user knows about search engines and might have heard about
77+ meta crawlers and privacy.
78+
79+Admin's POV: :origin:`docs/admin`
80+ A typical Admin knows about setting up services on a linux system, but he does
81+ not know all the pros and cons of a searx setup.
82+
83+Developer's POV: :origin:`docs/dev`
84+ Depending on the readability_ of code, a typical developer is able to read and
85+ understand source code. Describe what a item aims to do (e.g. a function).
86+ If the chronological order matters, describe it. Name the *out-of-limits
87+ conditions* and all the side effects a external developer will not know.
88+
89+.. _reST inline markup:
90+
91+Basic inline markup
92+===================
93+
94+.. sidebar:: Inline markup
95+
96+ - :ref:`reST roles`
97+ - :ref:`reST smart ref`
98+
99+Basic inline markup is done with asterisks and backquotes. If asterisks or
100+backquotes appear in running text and could be confused with inline markup
101+delimiters, they have to be escaped with a backslash (``\*pointer``).
102+
103+.. table:: basic inline markup
104+ :widths: 4 3 7
105+
106+ ================================================ ==================== ========================
107+ description rendered markup
108+ ================================================ ==================== ========================
109+ one asterisk for emphasis *italics* ``*italics*``
110+ two asterisks for strong emphasis **boldface** ``**boldface**``
111+ backquotes for code samples and literals ``foo()`` ````foo()````
112+ quote asterisks or backquotes \*foo is a pointer ``\*foo is a pointer``
113+ ================================================ ==================== ========================
114+
115+.. _reST basic structure:
116+
117+Basic article structure
118+=======================
119+
120+The basic structure of an article makes use of heading adornments to markup
121+chapter, sections and subsections.
122+
123+.. _reST template:
124+
125+reST template
126+-------------
127+
128+reST template for an simple article:
129+
130+.. code:: reST
131+
132+ .. _doc refname:
133+
134+ ==============
135+ Document title
136+ ==============
137+
138+ Lorem ipsum dolor sit amet, consectetur adipisici elit .. Further read
139+ :ref:`chapter refname`.
140+
141+ .. _chapter refname:
142+
143+ Chapter
144+ =======
145+
146+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
147+ aliquid ex ea commodi consequat ...
148+
149+ .. _section refname:
150+
151+ Section
152+ -------
153+
154+ lorem ..
155+
156+ .. _subsection refname:
157+
158+ Subsection
159+ ~~~~~~~~~~
160+
161+ lorem ..
162+
163+
164+Headings
165+--------
166+
167+#. title - with overline for document title:
168+
169+ .. code:: reST
170+
171+ ==============
172+ Document title
173+ ==============
174+
175+
176+#. chapter - with anchor named ``anchor name``:
177+
178+ .. code:: reST
179+
180+ .. _anchor name:
181+
182+ Chapter
183+ =======
184+
185+#. section
186+
187+ .. code:: reST
188+
189+ Section
190+ -------
191+
192+#. subsection
193+
194+ .. code:: reST
195+
196+ Subsection
197+ ~~~~~~~~~~
198+
199+
200+
201+Anchors & Links
202+===============
203+
204+.. _reST anchor:
205+
206+Anchors
207+-------
208+
209+.. _ref role:
210+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
211+
212+To refer a point in the documentation a anchor is needed. The :ref:`reST
213+template <reST template>` shows an example where a chapter titled *"Chapters"*
214+gets an anchor named ``chapter title``. Another example from *this* document,
215+where the anchor named ``reST anchor``:
216+
217+.. code:: reST
218+
219+ .. _reST anchor:
220+
221+ Anchors
222+ -------
223+
224+ To refer a point in the documentation a anchor is needed ...
225+
226+To refer anchors use the `ref role`_ markup:
227+
228+.. code:: reST
229+
230+ Visit chapter :ref:`reST anchor`. Or set hyperlink text manualy :ref:`foo
231+ bar <reST anchor>`.
232+
233+.. admonition:: ``:ref:`` role
234+ :class: rst-example
235+
236+ Visist chapter :ref:`reST anchor`. Or set hyperlink text manualy :ref:`foo
237+ bar <reST anchor>`.
238+
239+.. _reST ordinary ref:
240+
241+Link ordinary URL
242+-----------------
243+
244+If you need to reference external URLs use *named* hyperlinks to maintain
245+readability of reST sources. Here is a example taken from *this* article:
246+
247+.. code:: reST
248+
249+ .. _Sphinx Field Lists:
250+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html
251+
252+ With the *named* hyperlink `Sphinx Field Lists`_, the raw text is much more
253+ readable.
254+
255+ And this shows the alternative (less readable) hyperlink markup `Sphinx Field
256+ Lists
257+ <https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html>`__.
258+
259+.. admonition:: Named hyperlink
260+ :class: rst-example
261+
262+ With the *named* hyperlink `Sphinx Field Lists`_, the raw text is much more
263+ readable.
264+
265+ And this shows the alternative (less readable) hyperlink markup `Sphinx Field
266+ Lists
267+ <https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html>`__.
268+
269+
270+.. _reST smart ref:
271+
272+Smart refs
273+----------
274+
275+With the power of sphinx.ext.extlinks_ and intersphinx_ referencing external
276+content becomes smart.
277+
278+.. table:: smart refs with sphinx.ext.extlinks_ and intersphinx_
279+ :widths: 4 3 7
280+
281+ ========================== ================================== ====================================
282+ refer ... rendered example markup
283+ ========================== ================================== ====================================
284+ :rst:role:`rfc` :rfc:`822` ``:rfc:`822```
285+ :rst:role:`pep` :pep:`8` ``:pep:`8```
286+ sphinx.ext.extlinks_
287+ --------------------------------------------------------------------------------------------------
288+ project's wiki article :wiki:`Searx-instances` ``:wiki:`Searx-instances```
289+ to docs public URL :docs:`dev/reST.html` ``:docs:`dev/reST.html```
290+ files & folders origin :origin:`docs/dev/reST.rst` ``:origin:`docs/dev/reST.rst```
291+ pull request :pull:`1756` ``:pull:`1756```
292+ patch :patch:`af2cae6` ``:patch:`af2cae6```
293+ PyPi package :pypi:`searx` ``:pypi:`searx```
294+ manual page man :man:`bash` ``:man:`bash```
295+ intersphinx_
296+ --------------------------------------------------------------------------------------------------
297+ external anchor :ref:`python:and` ``:ref:`python:and```
298+ external doc anchor :doc:`jinja:templates` ``:doc:`jinja:templates```
299+ python code object :py:obj:`datetime.datetime` ``:py:obj:`datetime.datetime```
300+ flask code object :py:obj:`flask.Flask` ``:py:obj:`flask.Flask```
301+ ========================== ================================== ====================================
302+
303+
304+Intersphinx is configured in :origin:`docs/conf.py`:
305+
306+.. code:: python
307+
308+ intersphinx_mapping = {
309+ "python": ("https://docs.python.org/3/", None),
310+ "flask": ("https://flask.palletsprojects.com/", None),
311+ "jinja": ("https://jinja.palletsprojects.com/", None),
312+ "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
313+ "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
314+ }
315+
316+
317+To list all anchors of the inventory (e.g. ``python``) use:
318+
319+.. code:: sh
320+
321+ $ python -m sphinx.ext.intersphinx https://docs.python.org/3/objects.inv
322+
323+Literal blocks
324+==============
325+
326+The simplest form of :duref:`literal-blocks` is a indented block introduced by
327+two colons (``::``). For highlighting use :dudir:`highlight` or :ref:`reST
328+code` directive. To include literals from external files use directive
329+:dudir:`literalinclude`.
330+
331+.. _reST literal:
332+
333+``::``
334+------
335+
336+.. code:: reST
337+
338+ ::
339+
340+ Literal block
341+
342+ Lorem ipsum dolor::
343+
344+ Literal block
345+
346+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
347+ eirmod tempor invidunt ut labore ::
348+
349+ Literal block
350+
351+.. admonition:: Literal block
352+ :class: rst-example
353+
354+ ::
355+
356+ Literal block
357+
358+ Lorem ipsum dolor::
359+
360+ Literal block
361+
362+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
363+ eirmod tempor invidunt ut labore ::
364+
365+ Literal block
366+
367+
368+.. _reST code:
369+
370+``code-block``
371+--------------
372+
373+.. _pygments: https://pygments.org/languages/
374+
375+.. sidebar:: Syntax highlighting
376+
377+ is handled by pygments_.
378+
379+The :rst:dir:`code-block` directive is a variant of the :dudir:`code` directive
380+with additional options. To learn more about code literals visit
381+:ref:`sphinx:code-examples`.
382+
383+.. code-block:: reST
384+
385+ The URL ``/stats`` handle is shown in :ref:`stats-handle`
386+
387+ .. code-block:: Python
388+ :caption: python code block
389+ :name: stats-handle
390+
391+ @app.route('/stats', methods=['GET'])
392+ def stats():
393+ """Render engine statistics page."""
394+ stats = get_engines_stats()
395+ return render(
396+ 'stats.html'
397+ , stats = stats )
398+
399+.. code-block:: reST
400+
401+.. admonition:: Code block
402+ :class: rst-example
403+
404+ The URL ``/stats`` handle is shown in :ref:`stats-handle`
405+
406+ .. code-block:: Python
407+ :caption: python code block
408+ :name: stats-handle
409+
410+ @app.route('/stats', methods=['GET'])
411+ def stats():
412+ """Render engine statistics page."""
413+ stats = get_engines_stats()
414+ return render(
415+ 'stats.html'
416+ , stats = stats )
417+
418+Unicode substitution
419+====================
420+
421+The :dudir:`unicode directive <unicode-character-codes>` converts Unicode
422+character codes (numerical values) to characters. This directive can only be
423+used within a substitution definition.
424+
425+.. code-block:: reST
426+
427+ .. |copy| unicode:: 0xA9 .. copyright sign
428+ .. |(TM)| unicode:: U+2122
429+
430+ Trademark |(TM)| and copyright |copy| glyphs.
431+
432+.. admonition:: Unicode
433+ :class: rst-example
434+
435+ .. |copy| unicode:: 0xA9 .. copyright sign
436+ .. |(TM)| unicode:: U+2122
437+
438+ Trademark |(TM)| and copyright |copy| glyphs.
439+
440+
441+.. _reST roles:
442+
443+Roles
444+=====
445+
446+.. sidebar:: Further reading
447+
448+ - `Sphinx Roles`_
449+ - :doc:`sphinx:usage/restructuredtext/domains`
450+
451+
452+A *custom interpreted text role* (:duref:`ref <roles>`) is an inline piece of
453+explicit markup. It signifies that that the enclosed text should be interpreted
454+in a specific way.
455+
456+The general markup is one of:
457+
458+.. code:: reST
459+
460+ :rolename:`ref-name`
461+ :rolename:`ref text <ref-name>`
462+
463+.. table:: smart refs with sphinx.ext.extlinks_ and intersphinx_
464+ :widths: 4 3 7
465+
466+ ========================== ================================== ====================================
467+ role rendered example markup
468+ ========================== ================================== ====================================
469+ :rst:role:`guilabel` :guilabel:`&Cancel` ``:guilabel:`&Cancel```
470+ :rst:role:`kbd` :kbd:`C-x C-f` ``:kbd:`C-x C-f```
471+ :rst:role:`menuselection` :menuselection:`Open --> File` ``:menuselection:`Open --> File```
472+ :rst:role:`download` :download:`this file <reST.rst>` ``:download:`this file <reST.rst>```
473+ math_ :math:`a^2 + b^2 = c^2` ``:math:`a^2 + b^2 = c^2```
474+ :rst:role:`ref` :ref:`svg image example` ``:ref:`svg image example```
475+ :rst:role:`command` :command:`ls -la` ``:command:`ls -la```
476+ :durole:`emphasis` :emphasis:`italic` ``:emphasis:`italic```
477+ :durole:`strong` :strong:`bold` ``:strong:`bold```
478+ :durole:`literal` :literal:`foo()` ``:literal:`foo()```
479+ :durole:`subscript` H\ :sub:`2`\ O ``H\ :sub:`2`\ O``
480+ :durole:`superscript` E = mc\ :sup:`2` ``E = mc\ :sup:`2```
481+ :durole:`title-reference` :title:`Time` ``:title:`Time```
482+ ========================== ================================== ====================================
483+
484+Figures & Images
485+================
486+
487+.. sidebar:: Image processing
488+
489+ With the directives from :ref:`linuxdoc <linuxdoc:kfigure>` the build process
490+ is flexible. To get best results in the generated output format, install
491+ ImageMagick_ and Graphviz_.
492+
493+Searx's sphinx setup includes: :ref:`linuxdoc:kfigure`. Scaleable here means;
494+scaleable in sense of the build process. Normally in absence of a converter
495+tool, the build process will break. From the authors POV it’s annoying to care
496+about the build process when handling with images, especially since he has no
497+access to the build process. With :ref:`linuxdoc:kfigure` the build process
498+continues and scales output quality in dependence of installed image processors.
499+
500+If you want to add an image, you should use the ``kernel-figure`` (inheritance
501+of :dudir:`figure`) and ``kernel-image`` (inheritance of :dudir:`image`)
502+directives. E.g. to insert a figure with a scaleable image format use SVG
503+(:ref:`svg image example`):
504+
505+.. code:: reST
506+
507+ .. _svg image example:
508+
509+ .. kernel-figure:: svg_image.svg
510+ :alt: SVG image example
511+
512+ Simple SVG image
513+
514+ To refer the figure, a caption block is needed: :ref:`svg image example`.
515+
516+.. _svg image example:
517+
518+.. kernel-figure:: svg_image.svg
519+ :alt: SVG image example
520+
521+ Simple SVG image.
522+
523+To refer the figure, a caption block is needed: :ref:`svg image example`.
524+
525+DOT files (aka Graphviz)
526+------------------------
527+
528+With :ref:`linuxdoc:kernel-figure` reST support for **DOT** formatted files is
529+given.
530+
531+- `Graphviz's dot`_
532+- DOT_
533+- Graphviz_
534+
535+A simple example is shown in :ref:`dot file example`:
536+
537+.. code:: reST
538+
539+ .. _dot file example:
540+
541+ .. kernel-figure:: hello.dot
542+ :alt: hello world
543+
544+ DOT's hello world example
545+
546+.. admonition:: hello.dot
547+ :class: rst-example
548+
549+ .. _dot file example:
550+
551+ .. kernel-figure:: hello.dot
552+ :alt: hello world
553+
554+ DOT's hello world example
555+
556+``kernel-render`` DOT
557+---------------------
558+
559+Embed *render* markups (or languages) like Graphviz's **DOT** is provided by the
560+:ref:`linuxdoc:kernel-render` directive. A simple example of embedded DOT_ is
561+shown in figure :ref:`dot render example`:
562+
563+.. code:: reST
564+
565+ .. _dot render example:
566+
567+ .. kernel-render:: DOT
568+ :alt: digraph
569+ :caption: Embedded DOT (Graphviz) code
570+
571+ digraph foo {
572+ "bar" -> "baz";
573+ }
574+
575+ Attribute ``caption`` is needed, if you want to refer the figure: :ref:`dot
576+ render example`.
577+
578+Please note :ref:`build tools <linuxdoc:kfigure_build_tools>`. If Graphviz_ is
579+installed, you will see an vector image. If not, the raw markup is inserted as
580+*literal-block*.
581+
582+.. admonition:: kernel-render DOT
583+ :class: rst-example
584+
585+ .. _dot render example:
586+
587+ .. kernel-render:: DOT
588+ :alt: digraph
589+ :caption: Embedded DOT (Graphviz) code
590+
591+ digraph foo {
592+ "bar" -> "baz";
593+ }
594+
595+ Attribute ``caption`` is needed, if you want to refer the figure: :ref:`dot
596+ render example`.
597+
598+``kernel-render`` SVG
599+---------------------
600+
601+A simple example of embedded SVG_ is shown in figure :ref:`svg render example`:
602+
603+.. code:: reST
604+
605+ .. _svg render example:
606+
607+ .. kernel-render:: SVG
608+ :caption: Embedded **SVG** markup
609+ :alt: so-nw-arrow
610+..
611+
612+ .. code:: xml
613+
614+ <?xml version="1.0" encoding="UTF-8"?>
615+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
616+ baseProfile="full" width="70px" height="40px"
617+ viewBox="0 0 700 400"
618+ >
619+ <line x1="180" y1="370"
620+ x2="500" y2="50"
621+ stroke="black" stroke-width="15px"
622+ />
623+ <polygon points="585 0 525 25 585 50"
624+ transform="rotate(135 525 25)"
625+ />
626+ </svg>
627+
628+.. admonition:: kernel-render SVG
629+ :class: rst-example
630+
631+ .. _svg render example:
632+
633+ .. kernel-render:: SVG
634+ :caption: Embedded **SVG** markup
635+ :alt: so-nw-arrow
636+
637+ <?xml version="1.0" encoding="UTF-8"?>
638+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
639+ baseProfile="full" width="70px" height="40px"
640+ viewBox="0 0 700 400"
641+ >
642+ <line x1="180" y1="370"
643+ x2="500" y2="50"
644+ stroke="black" stroke-width="15px"
645+ />
646+ <polygon points="585 0 525 25 585 50"
647+ transform="rotate(135 525 25)"
648+ />
649+ </svg>
650+
651+
652+
653+
654+.. _reST lists:
655+
656+List markups
657+============
658+
659+Bullet list
660+-----------
661+
662+List markup (:duref:`ref <bullet-lists>`) is simple:
663+
664+.. code:: reST
665+
666+ - This is a bulleted list.
667+
668+ 1. Nested lists are possible, but be aware that they must be separated from
669+ the parent list items by blank line
670+ 2. Second item of nested list
671+
672+ - It has two items, the second
673+ item uses two lines.
674+
675+ #. This is a numbered list.
676+ #. It has two items too.
677+
678+.. admonition:: bullet list
679+ :class: rst-example
680+
681+ - This is a bulleted list.
682+
683+ 1. Nested lists are possible, but be aware that they must be separated from
684+ the parent list items by blank line
685+ 2. Second item of nested list
686+
687+ - It has two items, the second
688+ item uses two lines.
689+
690+ #. This is a numbered list.
691+ #. It has two items too.
692+
693+
694+Horizontal list
695+---------------
696+
697+The :rst:dir:`.. hlist:: <hlist>` transforms a bullet list into a more compact
698+list.
699+
700+.. code:: reST
701+
702+ .. hlist::
703+
704+ - first list item
705+ - second list item
706+ - third list item
707+ ...
708+
709+.. admonition:: hlist
710+ :class: rst-example
711+
712+ .. hlist::
713+
714+ - first list item
715+ - second list item
716+ - third list item
717+ - next list item
718+ - next list item xxxx
719+ - next list item yyyy
720+ - next list item zzzz
721+
722+
723+Definition list
724+---------------
725+
726+.. sidebar:: Note ..
727+
728+ - the term cannot have more than one line of text
729+
730+ - there is **no blank line between term and definition block** // this
731+ distinguishes definition lists (:duref:`ref <definition-lists>`) from block
732+ quotes (:duref:`ref <block-quotes>`).
733+
734+Each definition list (:duref:`ref <definition-lists>`) item contains a term,
735+optional classifiers and a definition. A term is a simple one-line word or
736+phrase. Optional classifiers may follow the term on the same line, each after
737+an inline ' : ' (**space, colon, space**). A definition is a block indented
738+relative to the term, and may contain multiple paragraphs and other body
739+elements. There may be no blank line between a term line and a definition block
740+(*this distinguishes definition lists from block quotes*). Blank lines are
741+required before the first and after the last definition list item, but are
742+optional in-between.
743+
744+Definition lists are created as follows:
745+
746+.. code:: reST
747+
748+ term 1 (up to a line of text)
749+ Definition 1.
750+
751+ See the typo : this line is not a term!
752+
753+ And this is not term's definition. **There is a blank line** in between
754+ the line above and this paragraph. That's why this paragraph is taken as
755+ **block quote** (:duref:`ref <block-quotes>`) and not as term's definition!
756+
757+ term 2
758+ Definition 2, paragraph 1.
759+
760+ Definition 2, paragraph 2.
761+
762+ term 3 : classifier
763+ Definition 3.
764+
765+ term 4 : classifier one : classifier two
766+ Definition 4.
767+
768+.. admonition:: definition list
769+ :class: rst-example
770+
771+ term 1 (up to a line of text)
772+ Definition 1.
773+
774+ See the typo : this line is not a term!
775+
776+ And this is not term's definition. **There is a blank line** in between
777+ the line above and this paragraph. That's why this paragraph is taken as
778+ **block quote** (:duref:`ref <block-quotes>`) and not as term's definition!
779+
780+
781+ term 2
782+ Definition 2, paragraph 1.
783+
784+ Definition 2, paragraph 2.
785+
786+ term 3 : classifier
787+ Definition 3.
788+
789+ term 4 : classifier one : classifier two
790+
791+
792+Quoted paragraphs
793+-----------------
794+
795+Quoted paragraphs (:duref:`ref <block-quotes>`) are created by just indenting
796+them more than the surrounding paragraphs. Line blocks (:duref:`ref
797+<line-blocks>`) are a way of preserving line breaks:
798+
799+.. code:: reST
800+
801+ normal paragraph ...
802+ lorem ipsum.
803+
804+ Quoted paragraph ...
805+ lorem ipsum.
806+
807+ | These lines are
808+ | broken exactly like in
809+ | the source file.
810+
811+
812+.. admonition:: Quoted paragraph and line block
813+ :class: rst-example
814+
815+ normal paragraph ...
816+ lorem ipsum.
817+
818+ Quoted paragraph ...
819+ lorem ipsum.
820+
821+ | These lines are
822+ | broken exactly like in
823+ | the source file.
824+
825+
826+.. _reST field list:
827+
828+Field Lists
829+-----------
830+
831+.. _Sphinx Field Lists:
832+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html
833+
834+.. sidebar:: bibliographic fields
835+
836+ First lines fields are bibliographic fields, see `Sphinx Field Lists`_.
837+
838+Field lists are used as part of an extension syntax, such as options for
839+directives, or database-like records meant for further processing. Field lists
840+are mappings from field names to field bodies. They marked up like this:
841+
842+.. code:: reST
843+
844+ :fieldname: Field content
845+ :foo: first paragraph in field foo
846+
847+ second paragraph in field foo
848+
849+ :bar: Field content
850+
851+.. admonition:: Field List
852+ :class: rst-example
853+
854+ :fieldname: Field content
855+ :foo: first paragraph in field foo
856+
857+ second paragraph in field foo
858+
859+ :bar: Field content
860+
861+
862+They are commonly used in Python documentation:
863+
864+.. code:: python
865+
866+ def my_function(my_arg, my_other_arg):
867+ """A function just for me.
868+
869+ :param my_arg: The first of my arguments.
870+ :param my_other_arg: The second of my arguments.
871+
872+ :returns: A message (just for me, of course).
873+ """
874+
875+Further list blocks
876+-------------------
877+
878+- field lists (:duref:`ref <field-lists>`, with caveats noted in
879+ :ref:`reST field list`)
880+- option lists (:duref:`ref <option-lists>`)
881+- quoted literal blocks (:duref:`ref <quoted-literal-blocks>`)
882+- doctest blocks (:duref:`ref <doctest-blocks>`)
883+
884+
885+Admonitions
886+===========
887+
888+Sidebar
889+-------
890+
891+Sidebar is an eye catcher, often used for admonitions pointing further stuff or
892+site effects. Here is the source of the sidebar :ref:`on top of this page <reST
893+primer>`.
894+
895+.. code:: reST
896+
897+ .. sidebar:: KISS_ and readability_
898+
899+ Instead of defining more and more roles, we at searx encourage our
900+ contributors to follow principles like KISS_ and readability_.
901+
902+Generic admonition
903+------------------
904+
905+The generic :dudir:`admonition <admonitions>` needs a title:
906+
907+.. code:: reST
908+
909+ .. admonition:: generic admonition title
910+
911+ lorem ipsum ..
912+
913+
914+.. admonition:: generic admonition title
915+
916+ lorem ipsum ..
917+
918+
919+Specific admonitions
920+--------------------
921+
922+Specific admonitions: :dudir:`hint`, :dudir:`note`, :dudir:`tip` :dudir:`attention`,
923+:dudir:`caution`, :dudir:`danger`, :dudir:`error`, , :dudir:`important`, and
924+:dudir:`warning` .
925+
926+.. code:: reST
927+
928+ .. hint::
929+
930+ lorem ipsum ..
931+
932+ .. note::
933+
934+ lorem ipsum ..
935+
936+ .. warning::
937+
938+ lorem ipsum ..
939+
940+
941+.. hint::
942+
943+ lorem ipsum ..
944+
945+.. note::
946+
947+ lorem ipsum ..
948+
949+.. tip::
950+
951+ lorem ipsum ..
952+
953+.. attention::
954+
955+ lorem ipsum ..
956+
957+.. caution::
958+
959+ lorem ipsum ..
960+
961+.. danger::
962+
963+ lorem ipsum ..
964+
965+.. important::
966+
967+ lorem ipsum ..
968+
969+.. error::
970+
971+ lorem ipsum ..
972+
973+.. warning::
974+
975+ lorem ipsum ..
976+
977+
978+Tables
979+======
980+
981+.. sidebar:: Nested tables
982+
983+ Nested tables are ugly! Not all builder support nested tables, don't use
984+ them!
985+
986+ASCII-art tables like :ref:`reST simple table` and :ref:`reST grid table` might
987+be comfortable for readers of the text-files, but they have huge disadvantages
988+in the creation and modifying. First, they are hard to edit. Think about
989+adding a row or a column to a ASCII-art table or adding a paragraph in a cell,
990+it is a nightmare on big tables.
991+
992+
993+.. sidebar:: List tables
994+
995+ For meaningful patch and diff use :ref:`reST flat table`.
996+
997+Second the diff of modifying ASCII-art tables is not meaningful, e.g. widening a
998+cell generates a diff in which also changes are included, which are only
999+ascribable to the ASCII-art. Anyway, if you prefer ASCII-art for any reason,
1000+here are some helpers:
1001+
1002+* `Emacs Table Mode`_
1003+* `Online Tables Generator`_
1004+
1005+.. _reST simple table:
1006+
1007+Simple tables
1008+-------------
1009+
1010+:duref:`Simple tables <simple-tables>` allow *colspan* but not *rowspan*. If
1011+your table need some metadata (e.g. a title) you need to add the ``.. table::
1012+directive`` :dudir:`(ref) <table>` in front and place the table in its body:
1013+
1014+.. code:: reST
1015+
1016+ .. table:: foo gate truth table
1017+ :widths: grid
1018+ :align: left
1019+
1020+ ====== ====== ======
1021+ Inputs Output
1022+ ------------- ------
1023+ A B A or B
1024+ ====== ====== ======
1025+ False
1026+ --------------------
1027+ True
1028+ --------------------
1029+ True False True
1030+ (foo)
1031+ ------ ------ ------
1032+ False True
1033+ (foo)
1034+ ====== =============
1035+
1036+.. admonition:: Simple ASCII table
1037+ :class: rst-example
1038+
1039+ .. table:: foo gate truth table
1040+ :widths: grid
1041+ :align: left
1042+
1043+ ====== ====== ======
1044+ Inputs Output
1045+ ------------- ------
1046+ A B A or B
1047+ ====== ====== ======
1048+ False
1049+ --------------------
1050+ True
1051+ --------------------
1052+ True False True
1053+ (foo)
1054+ ------ ------ ------
1055+ False True
1056+ (foo)
1057+ ====== =============
1058+
1059+
1060+
1061+.. _reST grid table:
1062+
1063+Grid tables
1064+-----------
1065+
1066+:duref:`Grid tables <grid-tables>` allow colspan *colspan* and *rowspan*:
1067+
1068+.. code:: reST
1069+
1070+ .. table:: grid table example
1071+ :widths: 1 1 5
1072+
1073+ +------------+------------+-----------+
1074+ | Header 1 | Header 2 | Header 3 |
1075+ +============+============+===========+
1076+ | body row 1 | column 2 | column 3 |
1077+ +------------+------------+-----------+
1078+ | body row 2 | Cells may span columns.|
1079+ +------------+------------+-----------+
1080+ | body row 3 | Cells may | - Cells |
1081+ +------------+ span rows. | - contain |
1082+ | body row 4 | | - blocks. |
1083+ +------------+------------+-----------+
1084+
1085+.. admonition:: ASCII grid table
1086+ :class: rst-example
1087+
1088+ .. table:: grid table example
1089+ :widths: 1 1 5
1090+
1091+ +------------+------------+-----------+
1092+ | Header 1 | Header 2 | Header 3 |
1093+ +============+============+===========+
1094+ | body row 1 | column 2 | column 3 |
1095+ +------------+------------+-----------+
1096+ | body row 2 | Cells may span columns.|
1097+ +------------+------------+-----------+
1098+ | body row 3 | Cells may | - Cells |
1099+ +------------+ span rows. | - contain |
1100+ | body row 4 | | - blocks. |
1101+ +------------+------------+-----------+
1102+
1103+
1104+.. _reST flat table:
1105+
1106+flat-table
1107+----------
1108+
1109+The ``flat-table`` is a further developed variant of the :ref:`list tables
1110+<linuxdoc:list-table-directives>`. It is a double-stage list similar to the
1111+:dudir:`list-table` with some additional features:
1112+
1113+column-span: ``cspan``
1114+ with the role ``cspan`` a cell can be extended through additional columns
1115+
1116+row-span: ``rspan``
1117+ with the role ``rspan`` a cell can be extended through additional rows
1118+
1119+auto-span:
1120+ spans rightmost cell of a table row over the missing cells on the right side
1121+ of that table-row. With Option ``:fill-cells:`` this behavior can changed
1122+ from *auto span* to *auto fill*, which automatically inserts (empty) cells
1123+ instead of spanning the last cell.
1124+
1125+options:
1126+ :header-rows: [int] count of header rows
1127+ :stub-columns: [int] count of stub columns
1128+ :widths: [[int] [int] ... ] widths of columns
1129+ :fill-cells: instead of auto-span missing cells, insert missing cells
1130+
1131+roles:
1132+ :cspan: [int] additional columns (*morecols*)
1133+ :rspan: [int] additional rows (*morerows*)
1134+
1135+The example below shows how to use this markup. The first level of the staged
1136+list is the *table-row*. In the *table-row* there is only one markup allowed,
1137+the list of the cells in this *table-row*. Exception are *comments* ( ``..`` )
1138+and *targets* (e.g. a ref to :ref:`row 2 of table's body <row body 2>`).
1139+
1140+.. code:: reST
1141+
1142+ .. flat-table:: ``flat-table`` example
1143+ :header-rows: 2
1144+ :stub-columns: 1
1145+ :widths: 1 1 1 1 2
1146+
1147+ * - :rspan:`1` head / stub
1148+ - :cspan:`3` head 1.1-4
1149+
1150+ * - head 2.1
1151+ - head 2.2
1152+ - head 2.3
1153+ - head 2.4
1154+
1155+ * .. row body 1 / this is a comment
1156+
1157+ - row 1
1158+ - :rspan:`2` cell 1-3.1
1159+ - cell 1.2
1160+ - cell 1.3
1161+ - cell 1.4
1162+
1163+ * .. Comments and targets are allowed on *table-row* stage.
1164+ .. _`row body 2`:
1165+
1166+ - row 2
1167+ - cell 2.2
1168+ - :rspan:`1` :cspan:`1`
1169+ cell 2.3 with a span over
1170+
1171+ * col 3-4 &
1172+ * row 2-3
1173+
1174+ * - row 3
1175+ - cell 3.2
1176+
1177+ * - row 4
1178+ - cell 4.1
1179+ - cell 4.2
1180+ - cell 4.3
1181+ - cell 4.4
1182+
1183+ * - row 5
1184+ - cell 5.1 with automatic span to rigth end
1185+
1186+ * - row 6
1187+ - cell 6.1
1188+ - ..
1189+
1190+
1191+.. admonition:: List table
1192+ :class: rst-example
1193+
1194+ .. flat-table:: ``flat-table`` example
1195+ :header-rows: 2
1196+ :stub-columns: 1
1197+ :widths: 1 1 1 1 2
1198+
1199+ * - :rspan:`1` head / stub
1200+ - :cspan:`3` head 1.1-4
1201+
1202+ * - head 2.1
1203+ - head 2.2
1204+ - head 2.3
1205+ - head 2.4
1206+
1207+ * .. row body 1 / this is a comment
1208+
1209+ - row 1
1210+ - :rspan:`2` cell 1-3.1
1211+ - cell 1.2
1212+ - cell 1.3
1213+ - cell 1.4
1214+
1215+ * .. Comments and targets are allowed on *table-row* stage.
1216+ .. _`row body 2`:
1217+
1218+ - row 2
1219+ - cell 2.2
1220+ - :rspan:`1` :cspan:`1`
1221+ cell 2.3 with a span over
1222+
1223+ * col 3-4 &
1224+ * row 2-3
1225+
1226+ * - row 3
1227+ - cell 3.2
1228+
1229+ * - row 4
1230+ - cell 4.1
1231+ - cell 4.2
1232+ - cell 4.3
1233+ - cell 4.4
1234+
1235+ * - row 5
1236+ - cell 5.1 with automatic span to rigth end
1237+
1238+ * - row 6
1239+ - cell 6.1
1240+ - ..
1241+
1242+
1243+CSV table
1244+---------
1245+
1246+CSV table might be the choice if you want to include CSV-data from a outstanding
1247+(build) process into your documentation.
1248+
1249+.. code:: reST
1250+
1251+ .. csv-table:: CSV table example
1252+ :header: .. , Column 1, Column 2
1253+ :widths: 2 5 5
1254+ :stub-columns: 1
1255+ :file: csv_table.txt
1256+
1257+Content of file ``csv_table.txt``:
1258+
1259+.. literalinclude:: csv_table.txt
1260+
1261+.. admonition:: CSV table
1262+ :class: rst-example
1263+
1264+ .. csv-table:: CSV table example
1265+ :header: .. , Column 1, Column 2
1266+ :widths: 3 5 5
1267+ :stub-columns: 1
1268+ :file: csv_table.txt
1269+
1270+Templating
1271+==========
1272+
1273+.. sidebar:: Build environment
1274+
1275+ All *generic-doc* tasks are running in the :ref:`build environment <make
1276+ pyenv>`.
1277+
1278+Templating is suitable for documentation which is created generic at the build
1279+time. The sphinx-jinja_ extension evaluates jinja_ templates in the :ref:`build
1280+environment <make pyenv>` (with searx modules installed). We use this e.g. to
1281+build chapter: :ref:`engines generic`. Below the jinja directive from the
1282+:origin:`docs/admin/engines.rst` is shown:
1283+
1284+.. literalinclude:: ../admin/engines.rst
1285+ :language: reST
1286+ :start-after: .. _configured engines:
1287+
1288+The context for the template is selected in the line ``.. jinja:: webapp``. In
1289+sphinx's build configuration (:origin:`docs/conf.py`) the ``webapp`` context
1290+points to the name space of the python module: ``webapp``.
1291+
1292+.. code:: py
1293+
1294+ from searx import webapp
1295+ jinja_contexts = {
1296+ 'webapp': dict(**webapp.__dict__)
1297+ }
1298+
1299+
1300+Tabbed views
1301+============
1302+
1303+.. _sphinx-tabs: https://github.com/djungelorm/sphinx-tabs
1304+.. _basic-tabs: https://github.com/djungelorm/sphinx-tabs#basic-tabs
1305+.. _group-tabs: https://github.com/djungelorm/sphinx-tabs#group-tabs
1306+.. _code-tabs: https://github.com/djungelorm/sphinx-tabs#code-tabs
1307+
1308+With `sphinx-tabs`_ extension we have *tabbed views*. To provide installation
1309+instructions with one tab per distribution we use the `group-tabs`_ directive,
1310+others are basic-tabs_ and code-tabs_. Below a *group-tab* example from
1311+:ref:`docs build` is shown:
1312+
1313+.. literalinclude:: ../admin/buildhosts.rst
1314+ :language: reST
1315+ :start-after: .. _system requirements:
1316+ :end-before: .. _system requirements END:
1317+
1318+
1319+.. _math:
1320+
1321+Math equations
1322+==============
1323+
1324+.. _Mathematics: https://en.wikibooks.org/wiki/LaTeX/Mathematics
1325+.. _amsmath user guide:
1326+ http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/macros/latex/required/amsmath/amsldoc.pdf
1327+
1328+.. sidebar:: About LaTeX
1329+
1330+ - `amsmath user guide`_
1331+ - Mathematics_
1332+ - :ref:`docs build`
1333+
1334+The input language for mathematics is LaTeX markup using the :ctan:`amsmath`
1335+package.
1336+
1337+To embed LaTeX markup in reST documents, use role :rst:role:`:math: <math>` for
1338+inline and directive :rst:dir:`.. math:: <math>` for block markup.
1339+
1340+.. code:: reST
1341+
1342+ In :math:numref:`schroedinger general` the time-dependent Schrödinger equation
1343+ is shown.
1344+
1345+ .. math::
1346+ :label: schroedinger general
1347+
1348+ \mathrm{i}\hbar\dfrac{\partial}{\partial t} |\,\psi (t) \rangle =
1349+ \hat{H} |\,\psi (t) \rangle.
1350+
1351+.. admonition:: LaTeX math equation
1352+ :class: rst-example
1353+
1354+ In :math:numref:`schroedinger general` the time-dependent Schrödinger equation
1355+ is shown.
1356+
1357+ .. math::
1358+ :label: schroedinger general
1359+
1360+ \mathrm{i}\hbar\dfrac{\partial}{\partial t} |\,\psi (t) \rangle =
1361+ \hat{H} |\,\psi (t) \rangle.
1362+
1363+
1364+The next example shows the difference of ``\tfrac`` (*textstyle*) and ``\dfrac``
1365+(*displaystyle*) used in a inline markup or another fraction.
1366+
1367+.. code:: reST
1368+
1369+ ``\tfrac`` **inline example** :math:`\tfrac{\tfrac{1}{x}+\tfrac{1}{y}}{y-z}`
1370+ ``\dfrac`` **inline example** :math:`\dfrac{\dfrac{1}{x}+\dfrac{1}{y}}{y-z}`
1371+
1372+.. admonition:: Line spacing
1373+ :class: rst-example
1374+
1375+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
1376+ eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
1377+ voluptua. ...
1378+ ``\tfrac`` **inline example** :math:`\tfrac{\tfrac{1}{x}+\tfrac{1}{y}}{y-z}`
1379+ At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
1380+ gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
1381+
1382+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
1383+ eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
1384+ voluptua. ...
1385+ ``\tfrac`` **inline example** :math:`\dfrac{\dfrac{1}{x}+\dfrac{1}{y}}{y-z}`
1386+ At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
1387+ gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
1388+
1389+
1390+.. _KISS: https://en.wikipedia.org/wiki/KISS_principle
1391+
1392+.. _readability: https://docs.python-guide.org/writing/style/
1393+.. _Sphinx-Primer:
1394+ http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
1395+.. _reST: https://docutils.sourceforge.io/rst.html
1396+.. _Sphinx Roles:
1397+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html
1398+.. _Sphinx: http://www.sphinx-doc.org
1399+.. _`sphinx-doc FAQ`: http://www.sphinx-doc.org/en/stable/faq.html
1400+.. _Sphinx markup constructs:
1401+ http://www.sphinx-doc.org/en/stable/markup/index.html
1402+.. _`sphinx cross references`:
1403+ http://www.sphinx-doc.org/en/stable/markup/inline.html#cross-referencing-arbitrary-locations
1404+.. _sphinx.ext.extlinks:
1405+ https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
1406+.. _intersphinx: http://www.sphinx-doc.org/en/stable/ext/intersphinx.html
1407+.. _sphinx config: http://www.sphinx-doc.org/en/stable/config.html
1408+.. _Sphinx's autodoc: http://www.sphinx-doc.org/en/stable/ext/autodoc.html
1409+.. _Sphinx's Python domain:
1410+ http://www.sphinx-doc.org/en/stable/domains.html#the-python-domain
1411+.. _Sphinx's C domain:
1412+ http://www.sphinx-doc.org/en/stable/domains.html#cross-referencing-c-constructs
1413+.. _doctree:
1414+ http://www.sphinx-doc.org/en/master/extdev/tutorial.html?highlight=doctree#build-phases
1415+.. _docutils: http://docutils.sourceforge.net/docs/index.html
1416+.. _docutils FAQ: http://docutils.sourceforge.net/FAQ.html
1417+.. _linuxdoc: https://return42.github.io/linuxdoc
1418+.. _jinja: https://jinja.palletsprojects.com/
1419+.. _sphinx-jinja: https://github.com/tardyp/sphinx-jinja
1420+.. _SVG: https://www.w3.org/TR/SVG11/expanded-toc.html
1421+.. _DOT: https://graphviz.gitlab.io/_pages/doc/info/lang.html
1422+.. _`Graphviz's dot`: https://graphviz.gitlab.io/_pages/pdf/dotguide.pdf
1423+.. _Graphviz: https://graphviz.gitlab.io
1424+.. _ImageMagick: https://www.imagemagick.org
1425+
1426+.. _`Emacs Table Mode`: https://www.emacswiki.org/emacs/TableMode
1427+.. _`Online Tables Generator`: http://www.tablesgenerator.com/text_tables
1428+.. _`OASIS XML Exchange Table Model`: https://www.oasis-open.org/specs/tm9901.html
_images/DOT-57a4a7f78690d0b6b884bc59f36e84cfb0b61f76.dotnew file+3
@@ -0,0 +1,3 @@
1+digraph foo {
2+ "bar" -> "baz";
3+}
_images/DOT-57a4a7f78690d0b6b884bc59f36e84cfb0b61f76.svgnew file+31
@@ -0,0 +1,31 @@
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4+<!-- Generated by graphviz version 2.40.1 (20161225.0304)
5+ -->
6+<!-- Title: foo Pages: 1 -->
7+<svg width="62pt" height="116pt"
8+ viewBox="0.00 0.00 62.00 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
10+<title>foo</title>
11+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-112 58,-112 58,4 -4,4"/>
12+<!-- bar -->
13+<g id="node1" class="node">
14+<title>bar</title>
15+<ellipse fill="none" stroke="#000000" cx="27" cy="-90" rx="27" ry="18"/>
16+<text text-anchor="middle" x="27" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">bar</text>
17+</g>
18+<!-- baz -->
19+<g id="node2" class="node">
20+<title>baz</title>
21+<ellipse fill="none" stroke="#000000" cx="27" cy="-18" rx="27" ry="18"/>
22+<text text-anchor="middle" x="27" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">baz</text>
23+</g>
24+<!-- bar&#45;&gt;baz -->
25+<g id="edge1" class="edge">
26+<title>bar&#45;&gt;baz</title>
27+<path fill="none" stroke="#000000" d="M27,-71.8314C27,-64.131 27,-54.9743 27,-46.4166"/>
28+<polygon fill="#000000" stroke="#000000" points="30.5001,-46.4132 27,-36.4133 23.5001,-46.4133 30.5001,-46.4132"/>
29+</g>
30+</g>
31+</svg>
_images/SVG-1fb7029fa2cc454a267bae271cccb2c591387416.svgnew file+13
@@ -0,0 +1,13 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
3+ baseProfile="full" width="70px" height="40px"
4+ viewBox="0 0 700 400"
5+ >
6+ <line x1="180" y1="370"
7+ x2="500" y2="50"
8+ stroke="black" stroke-width="15px"
9+ />
10+ <polygon points="585 0 525 25 585 50"
11+ transform="rotate(135 525 25)"
12+ />
13+</svg>
_images/arch_public.dotnew file+33
@@ -0,0 +1,33 @@
1+digraph G {
2+
3+ node [style=filled, shape=box, fillcolor="#ffffcc", fontname="Sans"];
4+ edge [fontname="Sans"];
5+
6+ browser [label="Browser", shape=Mdiamond];
7+ rp [label="Reverse Proxy", href="url to configure reverse proxy"];
8+ filtron [label="Filtron", href="https://github.com/asciimoo/filtron"];
9+ morty [label="Morty", href="https://github.com/asciimoo/morty"];
10+ static [label="Static files", href="url to configure static files"];
11+ uwsgi [label="uwsgi", href="url to configure uwsgi"]
12+ searx1 [label="Searx #1"];
13+ searx2 [label="Searx #2"];
14+ searx3 [label="Searx #3"];
15+ searx4 [label="Searx #4"];
16+
17+ browser -> rp [label="HTTPS"]
18+
19+ subgraph cluster_searx {
20+ label = "Searx instance" fontname="Sans";
21+ bgcolor="#fafafa";
22+ { rank=same; static rp };
23+ rp -> morty [label="optional: images and HTML pages proxy"];
24+ rp -> static [label="optional: reverse proxy serves directly static files"];
25+ rp -> filtron [label="HTTP"];
26+ filtron -> uwsgi [label="HTTP"];
27+ uwsgi -> searx1;
28+ uwsgi -> searx2;
29+ uwsgi -> searx3;
30+ uwsgi -> searx4;
31+ }
32+
33+}
_images/arch_public.svgnew file+156
@@ -0,0 +1,156 @@
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4+<!-- Generated by graphviz version 2.40.1 (20161225.0304)
5+ -->
6+<!-- Title: G Pages: 1 -->
7+<svg width="618pt" height="529pt"
8+ viewBox="0.00 0.00 618.00 529.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 525)">
10+<title>G</title>
11+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-525 614,-525 614,4 -4,4"/>
12+<g id="clust1" class="cluster">
13+<title>cluster_searx</title>
14+<polygon fill="#fafafa" stroke="#000000" points="8,-8 8,-444 602,-444 602,-8 8,-8"/>
15+<text text-anchor="middle" x="305" y="-428.8" font-family="Sans" font-size="14.00" fill="#000000">Searx instance</text>
16+</g>
17+<!-- browser -->
18+<g id="node1" class="node">
19+<title>browser</title>
20+<polygon fill="#ffffcc" stroke="#000000" points="75,-521 5.2878,-503 75,-485 144.7122,-503 75,-521"/>
21+<polyline fill="none" stroke="#000000" points="16.9067,-506.0001 16.9067,-499.9999 "/>
22+<polyline fill="none" stroke="#000000" points="63.3811,-488.0001 86.6189,-488.0001 "/>
23+<polyline fill="none" stroke="#000000" points="133.0933,-499.9999 133.0933,-506.0001 "/>
24+<polyline fill="none" stroke="#000000" points="86.6189,-517.9999 63.3811,-517.9999 "/>
25+<text text-anchor="middle" x="75" y="-499.3" font-family="Sans" font-size="14.00" fill="#000000">Browser</text>
26+</g>
27+<!-- rp -->
28+<g id="node2" class="node">
29+<title>rp</title>
30+<g id="a_node2"><a xlink:href="url to configure reverse proxy" xlink:title="Reverse Proxy">
31+<polygon fill="#ffffcc" stroke="#000000" points="134,-413 16,-413 16,-377 134,-377 134,-413"/>
32+<text text-anchor="middle" x="75" y="-391.3" font-family="Sans" font-size="14.00" fill="#000000">Reverse Proxy</text>
33+</a>
34+</g>
35+</g>
36+<!-- browser&#45;&gt;rp -->
37+<g id="edge1" class="edge">
38+<title>browser&#45;&gt;rp</title>
39+<path fill="none" stroke="#000000" d="M75,-484.6793C75,-467.821 75,-442.5651 75,-423.147"/>
40+<polygon fill="#000000" stroke="#000000" points="78.5001,-423.0501 75,-413.0502 71.5001,-423.0502 78.5001,-423.0501"/>
41+<text text-anchor="middle" x="98" y="-455.8" font-family="Sans" font-size="14.00" fill="#000000">HTTPS</text>
42+</g>
43+<!-- filtron -->
44+<g id="node3" class="node">
45+<title>filtron</title>
46+<g id="a_node3"><a xlink:href="https://github.com/asciimoo/filtron" xlink:title="Filtron">
47+<polygon fill="#ffffcc" stroke="#000000" points="105.5,-288 44.5,-288 44.5,-252 105.5,-252 105.5,-288"/>
48+<text text-anchor="middle" x="75" y="-266.3" font-family="Sans" font-size="14.00" fill="#000000">Filtron</text>
49+</a>
50+</g>
51+</g>
52+<!-- rp&#45;&gt;filtron -->
53+<g id="edge4" class="edge">
54+<title>rp&#45;&gt;filtron</title>
55+<path fill="none" stroke="#000000" d="M75,-376.8239C75,-356.2723 75,-322.5472 75,-298.4893"/>
56+<polygon fill="#000000" stroke="#000000" points="78.5001,-298.198 75,-288.198 71.5001,-298.198 78.5001,-298.198"/>
57+<text text-anchor="middle" x="93.5" y="-328.8" font-family="Sans" font-size="14.00" fill="#000000">HTTP</text>
58+</g>
59+<!-- morty -->
60+<g id="node4" class="node">
61+<title>morty</title>
62+<g id="a_node4"><a xlink:href="https://github.com/asciimoo/morty" xlink:title="Morty">
63+<polygon fill="#ffffcc" stroke="#000000" points="180.5,-288 123.5,-288 123.5,-252 180.5,-252 180.5,-288"/>
64+<text text-anchor="middle" x="152" y="-266.3" font-family="Sans" font-size="14.00" fill="#000000">Morty</text>
65+</a>
66+</g>
67+</g>
68+<!-- rp&#45;&gt;morty -->
69+<g id="edge2" class="edge">
70+<title>rp&#45;&gt;morty</title>
71+<path fill="none" stroke="#000000" d="M89.8355,-376.705C98.0006,-366.2543 108.0569,-352.7317 116,-340 124.4983,-326.3785 132.7784,-310.5167 139.2508,-297.3397"/>
72+<polygon fill="#000000" stroke="#000000" points="142.4243,-298.8167 143.6215,-288.2897 136.1209,-295.7724 142.4243,-298.8167"/>
73+<text text-anchor="middle" x="268" y="-328.8" font-family="Sans" font-size="14.00" fill="#000000">optional: images and HTML pages proxy</text>
74+</g>
75+<!-- static -->
76+<g id="node5" class="node">
77+<title>static</title>
78+<g id="a_node5"><a xlink:href="url to configure static files" xlink:title="Static files">
79+<polygon fill="#ffffcc" stroke="#000000" points="594,-413 504,-413 504,-377 594,-377 594,-413"/>
80+<text text-anchor="middle" x="549" y="-391.3" font-family="Sans" font-size="14.00" fill="#000000">Static files</text>
81+</a>
82+</g>
83+</g>
84+<!-- rp&#45;&gt;static -->
85+<g id="edge3" class="edge">
86+<title>rp&#45;&gt;static</title>
87+<path fill="none" stroke="#000000" d="M134.074,-395C226.433,-395 403.7479,-395 493.718,-395"/>
88+<polygon fill="#000000" stroke="#000000" points="493.7212,-398.5001 503.7212,-395 493.7211,-391.5001 493.7212,-398.5001"/>
89+<text text-anchor="middle" x="319" y="-401.8" font-family="Sans" font-size="14.00" fill="#000000">optional: reverse proxy serves directly static files</text>
90+</g>
91+<!-- uwsgi -->
92+<g id="node6" class="node">
93+<title>uwsgi</title>
94+<g id="a_node6"><a xlink:href="url to configure uwsgi" xlink:title="uwsgi">
95+<polygon fill="#ffffcc" stroke="#000000" points="188,-163 130,-163 130,-127 188,-127 188,-163"/>
96+<text text-anchor="middle" x="159" y="-141.3" font-family="Sans" font-size="14.00" fill="#000000">uwsgi</text>
97+</a>
98+</g>
99+</g>
100+<!-- filtron&#45;&gt;uwsgi -->
101+<g id="edge5" class="edge">
102+<title>filtron&#45;&gt;uwsgi</title>
103+<path fill="none" stroke="#000000" d="M87.2143,-251.8239C101.3983,-230.7169 124.9198,-195.7146 141.1515,-171.5603"/>
104+<polygon fill="#000000" stroke="#000000" points="144.0983,-173.4502 146.7709,-163.198 138.2883,-169.5459 144.0983,-173.4502"/>
105+<text text-anchor="middle" x="139.5" y="-203.8" font-family="Sans" font-size="14.00" fill="#000000">HTTP</text>
106+</g>
107+<!-- searx1 -->
108+<g id="node7" class="node">
109+<title>searx1</title>
110+<polygon fill="#ffffcc" stroke="#000000" points="99.5,-52 16.5,-52 16.5,-16 99.5,-16 99.5,-52"/>
111+<text text-anchor="middle" x="58" y="-30.3" font-family="Sans" font-size="14.00" fill="#000000">Searx #1</text>
112+</g>
113+<!-- uwsgi&#45;&gt;searx1 -->
114+<g id="edge6" class="edge">
115+<title>uwsgi&#45;&gt;searx1</title>
116+<path fill="none" stroke="#000000" d="M142.3219,-126.6706C125.7281,-108.4339 100.1175,-80.2876 81.4738,-59.7979"/>
117+<polygon fill="#000000" stroke="#000000" points="84.0217,-57.3975 74.7029,-52.3566 78.8442,-62.1086 84.0217,-57.3975"/>
118+</g>
119+<!-- searx2 -->
120+<g id="node8" class="node">
121+<title>searx2</title>
122+<polygon fill="#ffffcc" stroke="#000000" points="200.5,-52 117.5,-52 117.5,-16 200.5,-16 200.5,-52"/>
123+<text text-anchor="middle" x="159" y="-30.3" font-family="Sans" font-size="14.00" fill="#000000">Searx #2</text>
124+</g>
125+<!-- uwsgi&#45;&gt;searx2 -->
126+<g id="edge7" class="edge">
127+<title>uwsgi&#45;&gt;searx2</title>
128+<path fill="none" stroke="#000000" d="M159,-126.6706C159,-109.2373 159,-82.7482 159,-62.5489"/>
129+<polygon fill="#000000" stroke="#000000" points="162.5001,-62.3566 159,-52.3566 155.5001,-62.3567 162.5001,-62.3566"/>
130+</g>
131+<!-- searx3 -->
132+<g id="node9" class="node">
133+<title>searx3</title>
134+<polygon fill="#ffffcc" stroke="#000000" points="301.5,-52 218.5,-52 218.5,-16 301.5,-16 301.5,-52"/>
135+<text text-anchor="middle" x="260" y="-30.3" font-family="Sans" font-size="14.00" fill="#000000">Searx #3</text>
136+</g>
137+<!-- uwsgi&#45;&gt;searx3 -->
138+<g id="edge8" class="edge">
139+<title>uwsgi&#45;&gt;searx3</title>
140+<path fill="none" stroke="#000000" d="M175.6781,-126.6706C192.2719,-108.4339 217.8825,-80.2876 236.5262,-59.7979"/>
141+<polygon fill="#000000" stroke="#000000" points="239.1558,-62.1086 243.2971,-52.3566 233.9783,-57.3975 239.1558,-62.1086"/>
142+</g>
143+<!-- searx4 -->
144+<g id="node10" class="node">
145+<title>searx4</title>
146+<polygon fill="#ffffcc" stroke="#000000" points="402.5,-52 319.5,-52 319.5,-16 402.5,-16 402.5,-52"/>
147+<text text-anchor="middle" x="361" y="-30.3" font-family="Sans" font-size="14.00" fill="#000000">Searx #4</text>
148+</g>
149+<!-- uwsgi&#45;&gt;searx4 -->
150+<g id="edge9" class="edge">
151+<title>uwsgi&#45;&gt;searx4</title>
152+<path fill="none" stroke="#000000" d="M188.3725,-128.8596C222.8149,-109.9334 280.1532,-78.4257 319.2181,-56.9594"/>
153+<polygon fill="#000000" stroke="#000000" points="321.1614,-59.8852 328.2399,-52.0018 317.7903,-53.7504 321.1614,-59.8852"/>
154+</g>
155+</g>
156+</svg>
_images/hello.dotnew file+3
@@ -0,0 +1,3 @@
1+graph G {
2+ Hello -- World
3+}
_images/hello.svgnew file+30
@@ -0,0 +1,30 @@
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4+<!-- Generated by graphviz version 2.40.1 (20161225.0304)
5+ -->
6+<!-- Title: G Pages: 1 -->
7+<svg width="76pt" height="116pt"
8+ viewBox="0.00 0.00 75.59 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
10+<title>G</title>
11+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-112 71.594,-112 71.594,4 -4,4"/>
12+<!-- Hello -->
13+<g id="node1" class="node">
14+<title>Hello</title>
15+<ellipse fill="none" stroke="#000000" cx="33.797" cy="-90" rx="30.5947" ry="18"/>
16+<text text-anchor="middle" x="33.797" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">Hello</text>
17+</g>
18+<!-- World -->
19+<g id="node2" class="node">
20+<title>World</title>
21+<ellipse fill="none" stroke="#000000" cx="33.797" cy="-18" rx="33.5952" ry="18"/>
22+<text text-anchor="middle" x="33.797" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">World</text>
23+</g>
24+<!-- Hello&#45;&#45;World -->
25+<g id="edge1" class="edge">
26+<title>Hello&#45;&#45;World</title>
27+<path fill="none" stroke="#000000" d="M33.797,-71.8314C33.797,-61 33.797,-47.2876 33.797,-36.4133"/>
28+</g>
29+</g>
30+</svg>
_images/math/07c9ff4251510b06013159f4e45ec9ab97044096.svgnew file+25
@@ -0,0 +1,25 @@
1+<?xml version='1.0' encoding='UTF-8'?>
2+<!-- This file was generated by dvisvgm 2.6.1 -->
3+<svg height='48.422712pt' version='1.1' viewBox='57.608781 53.798251 36.523255 48.422712' width='36.523255pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
4+<defs>
5+<path d='M9.191532 -3.20797C9.428643 -3.20797 9.679701 -3.20797 9.679701 -3.486924S9.428643 -3.765878 9.191532 -3.765878H1.645828C1.408717 -3.765878 1.157659 -3.765878 1.157659 -3.486924S1.408717 -3.20797 1.645828 -3.20797H9.191532Z' id='g0-0'/>
6+<path d='M5.565131 -3.221918H9.414695C9.609963 -3.221918 9.861021 -3.221918 9.861021 -3.472976C9.861021 -3.737983 9.62391 -3.737983 9.414695 -3.737983H5.565131V-7.587547C5.565131 -7.782814 5.565131 -8.033873 5.314072 -8.033873C5.049066 -8.033873 5.049066 -7.796762 5.049066 -7.587547V-3.737983H1.199502C1.004234 -3.737983 0.753176 -3.737983 0.753176 -3.486924C0.753176 -3.221918 0.990286 -3.221918 1.199502 -3.221918H5.049066V0.627646C5.049066 0.822914 5.049066 1.073973 5.300125 1.073973C5.565131 1.073973 5.565131 0.836862 5.565131 0.627646V-3.221918Z' id='g2-43'/>
7+<path d='M4.016936 -8.940473C4.016936 -9.26127 4.016936 -9.275218 3.737983 -9.275218C3.403238 -8.89863 2.705853 -8.382565 1.26924 -8.382565V-7.978082C1.590037 -7.978082 2.287422 -7.978082 3.054545 -8.340722V-1.073973C3.054545 -0.571856 3.012702 -0.404483 1.785305 -0.404483H1.352927V0C1.729514 -0.027895 3.082441 -0.027895 3.542715 -0.027895S5.341968 -0.027895 5.718555 0V-0.404483H5.286177C4.05878 -0.404483 4.016936 -0.571856 4.016936 -1.073973V-8.940473Z' id='g2-49'/>
8+<path d='M6.611208 -5.69066C6.164882 -5.606974 5.997509 -5.272229 5.997509 -5.007223C5.997509 -4.672478 6.262516 -4.560897 6.457783 -4.560897C6.876214 -4.560897 7.169116 -4.923537 7.169116 -5.300125C7.169116 -5.885928 6.499626 -6.150934 5.913823 -6.150934C5.063014 -6.150934 4.588792 -5.314072 4.463263 -5.049066C4.142466 -6.095143 3.277709 -6.150934 3.02665 -6.150934C1.603985 -6.150934 0.850809 -4.323786 0.850809 -4.016936C0.850809 -3.961146 0.9066 -3.891407 1.004234 -3.891407C1.115816 -3.891407 1.143711 -3.975093 1.171606 -4.030884C1.645828 -5.579078 2.580324 -5.87198 2.984807 -5.87198C3.612453 -5.87198 3.737983 -5.286177 3.737983 -4.951432C3.737983 -4.644583 3.654296 -4.323786 3.486924 -3.654296L3.012702 -1.743462C2.803487 -0.9066 2.399004 -0.139477 1.659776 -0.139477C1.590037 -0.139477 1.241345 -0.139477 0.948443 -0.320797C1.45056 -0.418431 1.562142 -0.836862 1.562142 -1.004234C1.562142 -1.283188 1.352927 -1.45056 1.08792 -1.45056C0.753176 -1.45056 0.390535 -1.157659 0.390535 -0.711333C0.390535 -0.125529 1.046077 0.139477 1.645828 0.139477C2.315318 0.139477 2.789539 -0.390535 3.082441 -0.962391C3.305604 -0.139477 4.002989 0.139477 4.519054 0.139477C5.941719 0.139477 6.694894 -1.687671 6.694894 -1.994521C6.694894 -2.064259 6.639103 -2.12005 6.555417 -2.12005C6.429888 -2.12005 6.41594 -2.050311 6.374097 -1.93873C5.997509 -0.711333 5.188543 -0.139477 4.560897 -0.139477C4.072727 -0.139477 3.807721 -0.502117 3.807721 -1.073973C3.807721 -1.380822 3.863512 -1.603985 4.086675 -2.524533L4.574844 -4.42142C4.78406 -5.258281 5.258281 -5.87198 5.899875 -5.87198C5.927771 -5.87198 6.318306 -5.87198 6.611208 -5.69066Z' id='g1-120'/>
9+<path d='M3.668244 1.562142C3.291656 2.092154 2.747696 2.566376 2.064259 2.566376C1.896887 2.566376 1.227397 2.538481 1.018182 1.896887C1.060025 1.910834 1.129763 1.910834 1.157659 1.910834C1.57609 1.910834 1.855044 1.548194 1.855044 1.227397S1.590037 0.795019 1.380822 0.795019C1.157659 0.795019 0.669489 0.962391 0.669489 1.645828C0.669489 2.357161 1.26924 2.84533 2.064259 2.84533C3.459029 2.84533 4.867746 1.562142 5.258281 0.013948L6.625156 -5.425654C6.639103 -5.495392 6.666999 -5.579078 6.666999 -5.662765C6.666999 -5.87198 6.499626 -6.011457 6.290411 -6.011457C6.164882 -6.011457 5.87198 -5.955666 5.760399 -5.537235L4.728269 -1.436613C4.658531 -1.185554 4.658531 -1.157659 4.546949 -1.004234C4.267995 -0.613699 3.807721 -0.139477 3.138232 -0.139477C2.357161 -0.139477 2.287422 -0.9066 2.287422 -1.283188C2.287422 -2.078207 2.66401 -3.152179 3.040598 -4.156413C3.194022 -4.560897 3.277709 -4.756164 3.277709 -5.035118C3.277709 -5.620922 2.859278 -6.150934 2.175841 -6.150934C0.892653 -6.150934 0.376588 -4.128518 0.376588 -4.016936C0.376588 -3.961146 0.432379 -3.891407 0.530012 -3.891407C0.655542 -3.891407 0.669489 -3.947198 0.72528 -4.142466C1.060025 -5.314072 1.590037 -5.87198 2.133998 -5.87198C2.259527 -5.87198 2.496638 -5.87198 2.496638 -5.411706C2.496638 -5.049066 2.343213 -4.644583 2.133998 -4.11457C1.45056 -2.287422 1.45056 -1.827148 1.45056 -1.492403C1.45056 -0.167372 2.399004 0.139477 3.096389 0.139477C3.500872 0.139477 4.002989 0.013948 4.491158 -0.502117L4.505106 -0.488169C4.29589 0.334745 4.156413 0.878705 3.668244 1.562142Z' id='g1-121'/>
10+<path d='M1.771357 -1.129763C2.371108 -1.8132 2.859278 -2.245579 3.556663 -2.873225C4.393524 -3.598506 4.756164 -3.947198 4.951432 -4.156413C5.927771 -5.118804 6.41594 -5.927771 6.41594 -6.039352S6.304359 -6.150934 6.276463 -6.150934C6.178829 -6.150934 6.150934 -6.095143 6.081196 -5.997509C5.732503 -5.397758 5.397758 -5.104857 5.035118 -5.104857C4.742217 -5.104857 4.588792 -5.230386 4.323786 -5.565131C4.030884 -5.913823 3.793773 -6.150934 3.38929 -6.150934C2.371108 -6.150934 1.75741 -4.881694 1.75741 -4.588792C1.75741 -4.546949 1.771357 -4.463263 1.896887 -4.463263C2.008468 -4.463263 2.022416 -4.519054 2.064259 -4.616687C2.30137 -5.174595 2.970859 -5.272229 3.235866 -5.272229C3.528767 -5.272229 3.807721 -5.174595 4.100623 -5.049066C4.630635 -4.825903 4.853798 -4.825903 4.993275 -4.825903C5.090909 -4.825903 5.1467 -4.825903 5.216438 -4.839851C4.756164 -4.29589 4.002989 -3.626401 3.375342 -3.054545L1.966625 -1.75741C1.115816 -0.892653 0.599751 -0.069738 0.599751 0.027895C0.599751 0.111582 0.669489 0.139477 0.753176 0.139477S0.850809 0.125529 0.948443 -0.041843C1.171606 -0.390535 1.617933 -0.9066 2.133998 -0.9066C2.426899 -0.9066 2.566376 -0.808966 2.84533 -0.460274C3.110336 -0.153425 3.347447 0.139477 3.793773 0.139477C5.160648 0.139477 5.941719 -1.63188 5.941719 -1.952677C5.941719 -2.008468 5.927771 -2.092154 5.788294 -2.092154C5.676712 -2.092154 5.662765 -2.036364 5.620922 -1.896887C5.314072 -1.073973 4.491158 -0.739228 3.947198 -0.739228C3.654296 -0.739228 3.375342 -0.836862 3.082441 -0.962391C2.524533 -1.185554 2.371108 -1.185554 2.189788 -1.185554C2.050311 -1.185554 1.896887 -1.185554 1.771357 -1.129763Z' id='g1-122'/>
11+</defs>
12+<g id='page1'>
13+<use x='59.270442' xlink:href='#g2-49' y='62.786766'/>
14+<rect height='0.55789' width='7.760768' x='58.804295' y='68.456606'/>
15+<use x='58.804295' xlink:href='#g1-120' y='81.789907'/>
16+<use x='70.860038' xlink:href='#g2-43' y='72.222482'/>
17+<use x='85.942577' xlink:href='#g2-49' y='62.786766'/>
18+<rect height='0.55789' width='7.159416' x='85.777106' y='68.456606'/>
19+<use x='85.777106' xlink:href='#g1-121' y='81.789907'/>
20+<rect height='0.55789' width='36.523255' x='57.608781' y='86.175621'/>
21+<use x='60.284264' xlink:href='#g1-121' y='99.508922'/>
22+<use x='70.543155' xlink:href='#g0-0' y='99.508922'/>
23+<use x='84.490862' xlink:href='#g1-122' y='99.508922'/>
24+</g>
25+</svg>
_images/math/3b8127a8eed95247f9249ea6c85e8e86df1baa82.svgnew file+25
@@ -0,0 +1,25 @@
1+<?xml version='1.0' encoding='UTF-8'?>
2+<!-- This file was generated by dvisvgm 2.6.1 -->
3+<svg height='29.523663pt' version='1.1' viewBox='57.608781 53.79825 23.092891 29.523663' width='23.092891pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
4+<defs>
5+<path d='M6.434044 -2.245569C6.600021 -2.245569 6.775761 -2.245569 6.775761 -2.440836S6.600021 -2.636103 6.434044 -2.636103H1.152075C0.986098 -2.636103 0.810358 -2.636103 0.810358 -2.440836S0.986098 -2.245569 1.152075 -2.245569H6.434044Z' id='g0-0'/>
6+<path d='M3.993208 -2.245569H6.717181C6.853868 -2.245569 7.039372 -2.245569 7.039372 -2.440836S6.853868 -2.636103 6.717181 -2.636103H3.993208V-5.36984C3.993208 -5.506526 3.993208 -5.69203 3.797941 -5.69203S3.602674 -5.506526 3.602674 -5.36984V-2.636103H0.868938C0.732251 -2.636103 0.546747 -2.636103 0.546747 -2.440836S0.732251 -2.245569 0.868938 -2.245569H3.602674V0.488167C3.602674 0.624854 3.602674 0.810358 3.797941 0.810358S3.993208 0.624854 3.993208 0.488167V-2.245569Z' id='g2-43'/>
7+<path d='M2.870423 -6.248541C2.870423 -6.482861 2.870423 -6.502388 2.645866 -6.502388C2.040539 -5.877534 1.181365 -5.877534 0.868938 -5.877534V-5.57487C1.064205 -5.57487 1.640242 -5.57487 2.147936 -5.828717V-0.771304C2.147936 -0.419824 2.118646 -0.302664 1.239945 -0.302664H0.927518V0C1.269235 -0.02929 2.118646 -0.02929 2.50918 -0.02929S3.749124 -0.02929 4.090841 0V-0.302664H3.778414C2.899713 -0.302664 2.870423 -0.41006 2.870423 -0.771304V-6.248541Z' id='g2-49'/>
8+<path d='M3.260957 -2.94853C3.319537 -3.202377 3.544094 -4.100605 4.227528 -4.100605C4.276345 -4.100605 4.510665 -4.100605 4.715696 -3.973681C4.442322 -3.924865 4.247055 -3.680781 4.247055 -3.446461C4.247055 -3.290247 4.354452 -3.104744 4.618062 -3.104744C4.832856 -3.104744 5.145283 -3.280484 5.145283 -3.671018C5.145283 -4.178712 4.569245 -4.315398 4.237292 -4.315398C3.671018 -4.315398 3.329301 -3.797941 3.21214 -3.573384C2.968057 -4.217765 2.440836 -4.315398 2.157699 -4.315398C1.142311 -4.315398 0.585801 -3.055927 0.585801 -2.811843C0.585801 -2.71421 0.683434 -2.71421 0.702961 -2.71421C0.781068 -2.71421 0.810358 -2.733737 0.829884 -2.821607C1.161838 -3.856521 1.806219 -4.100605 2.138172 -4.100605C2.323676 -4.100605 2.665393 -4.012735 2.665393 -3.446461C2.665393 -3.143797 2.499416 -2.489653 2.138172 -1.122785C1.981959 -0.517457 1.640242 -0.107397 1.210655 -0.107397C1.152075 -0.107397 0.927518 -0.107397 0.722488 -0.23432C0.966571 -0.283137 1.181365 -0.488167 1.181365 -0.761541C1.181365 -1.025151 0.966571 -1.103258 0.820121 -1.103258C0.527221 -1.103258 0.283137 -0.849411 0.283137 -0.536984C0.283137 -0.08787 0.771304 0.107397 1.200891 0.107397C1.845272 0.107397 2.196753 -0.576037 2.226043 -0.634617C2.343203 -0.273374 2.694683 0.107397 3.280484 0.107397C4.286108 0.107397 4.842619 -1.152075 4.842619 -1.396158C4.842619 -1.493792 4.754749 -1.493792 4.725459 -1.493792C4.637589 -1.493792 4.618062 -1.454738 4.598535 -1.386395C4.276345 -0.341717 3.612438 -0.107397 3.300011 -0.107397C2.91924 -0.107397 2.763027 -0.419824 2.763027 -0.751778C2.763027 -0.966571 2.821607 -1.181365 2.929003 -1.610952L3.260957 -2.94853Z' id='g1-120'/>
9+<path d='M4.744986 -3.719834C4.784039 -3.856521 4.784039 -3.876048 4.784039 -3.944391C4.784039 -4.120131 4.647352 -4.208002 4.500902 -4.208002C4.403268 -4.208002 4.247055 -4.149422 4.159185 -4.002971C4.139658 -3.954155 4.061551 -3.651491 4.022498 -3.475751C3.954155 -3.221904 3.885811 -2.958293 3.827231 -2.694683L3.387881 -0.937281C3.348827 -0.790831 2.929003 -0.107397 2.284623 -0.107397C1.786692 -0.107397 1.679295 -0.536984 1.679295 -0.898228C1.679295 -1.347342 1.845272 -1.952669 2.177226 -2.811843C2.333439 -3.21214 2.372493 -3.319537 2.372493 -3.514804C2.372493 -3.954155 2.060066 -4.315398 1.571899 -4.315398C0.644381 -4.315398 0.283137 -2.899713 0.283137 -2.811843C0.283137 -2.71421 0.38077 -2.71421 0.400297 -2.71421C0.497931 -2.71421 0.507694 -2.733737 0.556511 -2.88995C0.820121 -3.807704 1.210655 -4.100605 1.542608 -4.100605C1.620715 -4.100605 1.786692 -4.100605 1.786692 -3.788178C1.786692 -3.544094 1.689059 -3.290247 1.620715 -3.104744C1.230181 -2.069829 1.054441 -1.513318 1.054441 -1.054441C1.054441 -0.185504 1.669532 0.107397 2.245569 0.107397C2.62634 0.107397 2.958293 -0.05858 3.231667 -0.331954C3.104744 0.17574 2.987583 0.654144 2.59705 1.171601C2.343203 1.503555 1.972196 1.786692 1.523082 1.786692C1.386395 1.786692 0.947044 1.757402 0.781068 1.376632C0.937281 1.376632 1.064205 1.376632 1.200891 1.259471C1.298525 1.171601 1.396158 1.044678 1.396158 0.859174C1.396158 0.556511 1.132548 0.517457 1.034915 0.517457C0.810358 0.517457 0.488167 0.673671 0.488167 1.152075C0.488167 1.640242 0.917754 2.001486 1.523082 2.001486C2.528706 2.001486 3.534331 1.113021 3.807704 0.009763L4.744986 -3.719834Z' id='g1-121'/>
10+<path d='M1.298525 -0.810358C1.825745 -1.376632 2.108882 -1.620715 2.460363 -1.923379C2.460363 -1.933142 3.06569 -2.4506 3.417171 -2.80208C4.344688 -3.710071 4.559482 -4.178712 4.559482 -4.217765C4.559482 -4.315398 4.471612 -4.315398 4.452085 -4.315398C4.383742 -4.315398 4.354452 -4.295872 4.305635 -4.208002C4.012735 -3.739361 3.807704 -3.583148 3.573384 -3.583148S3.221904 -3.729598 3.075454 -3.895575C2.88995 -4.120131 2.723973 -4.315398 2.401783 -4.315398C1.669532 -4.315398 1.220418 -3.407407 1.220418 -3.202377C1.220418 -3.15356 1.249708 -3.09498 1.337578 -3.09498S1.444975 -3.143797 1.464502 -3.202377C1.650005 -3.651491 2.216279 -3.661254 2.294386 -3.661254C2.499416 -3.661254 2.68492 -3.592911 2.909477 -3.514804C3.300011 -3.368354 3.407407 -3.368354 3.661254 -3.368354C3.309774 -2.94853 2.489653 -2.245569 2.304149 -2.089356L1.425448 -1.269235C0.761541 -0.615091 0.419824 -0.05858 0.419824 0.009763C0.419824 0.107397 0.517457 0.107397 0.536984 0.107397C0.615091 0.107397 0.634617 0.08787 0.693197 -0.019527C0.917754 -0.361244 1.210655 -0.624854 1.523082 -0.624854C1.747639 -0.624854 1.845272 -0.536984 2.089356 -0.253847C2.255333 -0.048817 2.431073 0.107397 2.71421 0.107397C3.680781 0.107397 4.247055 -1.132548 4.247055 -1.396158C4.247055 -1.444975 4.208002 -1.493792 4.129895 -1.493792C4.042025 -1.493792 4.022498 -1.435212 3.993208 -1.366868C3.768651 -0.732251 3.143797 -0.546747 2.821607 -0.546747C2.62634 -0.546747 2.4506 -0.605327 2.245569 -0.673671C1.913616 -0.800594 1.767165 -0.839648 1.562135 -0.839648C1.542608 -0.839648 1.386395 -0.839648 1.298525 -0.810358Z' id='g1-122'/>
11+</defs>
12+<g id='page1'>
13+<use x='59.153464' xlink:href='#g2-49' y='60.090183'/>
14+<rect height='0.55789' width='5.580027' x='58.804295' y='61.81595'/>
15+<use x='58.804295' xlink:href='#g1-120' y='70.391549'/>
16+<use x='65.579836' xlink:href='#g2-43' y='65.581827'/>
17+<use x='74.496784' xlink:href='#g2-49' y='60.090183'/>
18+<rect height='0.55789' width='5.137078' x='74.369089' y='61.81595'/>
19+<use x='74.369089' xlink:href='#g1-121' y='70.391549'/>
20+<rect height='0.55789' width='23.092891' x='57.608781' y='72.847884'/>
21+<use x='60.304908' xlink:href='#g1-121' y='81.423483'/>
22+<use x='65.441996' xlink:href='#g0-0' y='81.423483'/>
23+<use x='73.035735' xlink:href='#g1-122' y='81.423483'/>
24+</g>
25+</svg>
_images/math/6673b43f9fe29455c1fcd1164e5844698cc64d38.svgnew file+22
@@ -0,0 +1,22 @@
1+<?xml version='1.0' encoding='UTF-8'?>
2+<!-- This file was generated by dvisvgm 2.6.1 -->
3+<svg height='12.418845pt' version='1.1' viewBox='56.413267 54.399982 69.686469 12.418845' width='69.686469pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
4+<defs>
5+<path d='M5.565131 -3.221918H9.414695C9.609963 -3.221918 9.861021 -3.221918 9.861021 -3.472976C9.861021 -3.737983 9.62391 -3.737983 9.414695 -3.737983H5.565131V-7.587547C5.565131 -7.782814 5.565131 -8.033873 5.314072 -8.033873C5.049066 -8.033873 5.049066 -7.796762 5.049066 -7.587547V-3.737983H1.199502C1.004234 -3.737983 0.753176 -3.737983 0.753176 -3.486924C0.753176 -3.221918 0.990286 -3.221918 1.199502 -3.221918H5.049066V0.627646C5.049066 0.822914 5.049066 1.073973 5.300125 1.073973C5.565131 1.073973 5.565131 0.836862 5.565131 0.627646V-3.221918Z' id='g2-43'/>
6+<path d='M9.414695 -4.519054C9.609963 -4.519054 9.861021 -4.519054 9.861021 -4.770112C9.861021 -5.035118 9.62391 -5.035118 9.414695 -5.035118H1.199502C1.004234 -5.035118 0.753176 -5.035118 0.753176 -4.78406C0.753176 -4.519054 0.990286 -4.519054 1.199502 -4.519054H9.414695ZM9.414695 -1.924782C9.609963 -1.924782 9.861021 -1.924782 9.861021 -2.175841C9.861021 -2.440847 9.62391 -2.440847 9.414695 -2.440847H1.199502C1.004234 -2.440847 0.753176 -2.440847 0.753176 -2.189788C0.753176 -1.924782 0.990286 -1.924782 1.199502 -1.924782H9.414695Z' id='g2-61'/>
7+<path d='M4.198257 -1.659776C4.128518 -1.422665 4.128518 -1.39477 3.93325 -1.129763C3.626401 -0.739228 3.012702 -0.139477 2.357161 -0.139477C1.785305 -0.139477 1.464508 -0.655542 1.464508 -1.478456C1.464508 -2.245579 1.896887 -3.807721 2.161893 -4.393524C2.636115 -5.369863 3.291656 -5.87198 3.835616 -5.87198C4.756164 -5.87198 4.937484 -4.728269 4.937484 -4.616687C4.937484 -4.60274 4.895641 -4.42142 4.881694 -4.393524L4.198257 -1.659776ZM5.090909 -5.230386C4.937484 -5.593026 4.560897 -6.150934 3.835616 -6.150934C2.259527 -6.150934 0.557908 -4.11457 0.557908 -2.050311C0.557908 -0.669489 1.366874 0.139477 2.315318 0.139477C3.082441 0.139477 3.737983 -0.460274 4.128518 -0.920548C4.267995 -0.097634 4.923537 0.139477 5.341968 0.139477S6.095143 -0.111582 6.346202 -0.613699C6.569365 -1.08792 6.764633 -1.93873 6.764633 -1.994521C6.764633 -2.064259 6.708842 -2.12005 6.625156 -2.12005C6.499626 -2.12005 6.485679 -2.050311 6.429888 -1.841096C6.220672 -1.018182 5.955666 -0.139477 5.383811 -0.139477C4.979328 -0.139477 4.951432 -0.502117 4.951432 -0.781071C4.951432 -1.101868 4.993275 -1.255293 5.118804 -1.799253C5.216438 -2.147945 5.286177 -2.454795 5.397758 -2.859278C5.913823 -4.951432 6.039352 -5.453549 6.039352 -5.537235C6.039352 -5.732503 5.885928 -5.885928 5.676712 -5.885928C5.230386 -5.885928 5.118804 -5.397758 5.090909 -5.230386Z' id='g0-97'/>
8+<path d='M3.221918 -9.331009C3.235866 -9.3868 3.263761 -9.470486 3.263761 -9.540224C3.263761 -9.679701 3.124284 -9.679701 3.096389 -9.679701C3.082441 -9.679701 2.580324 -9.637858 2.329265 -9.609963C2.092154 -9.596015 1.882939 -9.56812 1.63188 -9.554172C1.297136 -9.526276 1.199502 -9.512329 1.199502 -9.26127C1.199502 -9.121793 1.338979 -9.121793 1.478456 -9.121793C2.189788 -9.121793 2.189788 -8.996264 2.189788 -8.856787C2.189788 -8.759153 2.078207 -8.35467 2.022416 -8.103611L1.687671 -6.764633C1.548194 -6.206725 0.753176 -3.040598 0.697385 -2.789539C0.627646 -2.440847 0.627646 -2.203736 0.627646 -2.022416C0.627646 -0.599751 1.422665 0.139477 2.329265 0.139477C3.947198 0.139477 5.620922 -1.93873 5.620922 -3.961146C5.620922 -5.244334 4.895641 -6.150934 3.849564 -6.150934C3.124284 -6.150934 2.468742 -5.551183 2.203736 -5.272229L3.221918 -9.331009ZM2.343213 -0.139477C1.896887 -0.139477 1.408717 -0.474222 1.408717 -1.562142C1.408717 -2.022416 1.45056 -2.287422 1.701619 -3.263761C1.743462 -3.445081 1.966625 -4.337733 2.022416 -4.519054C2.050311 -4.630635 2.873225 -5.87198 3.821669 -5.87198C4.435367 -5.87198 4.714321 -5.258281 4.714321 -4.533001C4.714321 -3.863512 4.323786 -2.287422 3.975093 -1.562142C3.626401 -0.808966 2.984807 -0.139477 2.343213 -0.139477Z' id='g0-98'/>
9+<path d='M5.453549 -5.244334C5.188543 -5.244334 5.063014 -5.244334 4.867746 -5.076961C4.78406 -5.007223 4.630635 -4.798007 4.630635 -4.574844C4.630635 -4.29589 4.839851 -4.128518 5.104857 -4.128518C5.439601 -4.128518 5.816189 -4.407472 5.816189 -4.96538C5.816189 -5.634869 5.174595 -6.150934 4.212204 -6.150934C2.385056 -6.150934 0.557908 -4.156413 0.557908 -2.175841C0.557908 -0.962391 1.311083 0.139477 2.733748 0.139477C4.630635 0.139477 5.830137 -1.338979 5.830137 -1.520299C5.830137 -1.603985 5.746451 -1.673724 5.69066 -1.673724C5.648817 -1.673724 5.634869 -1.659776 5.50934 -1.534247C4.616687 -0.348692 3.291656 -0.139477 2.761644 -0.139477C1.799253 -0.139477 1.492403 -0.976339 1.492403 -1.673724C1.492403 -2.161893 1.729514 -3.514819 2.231631 -4.463263C2.594271 -5.118804 3.347447 -5.87198 4.226152 -5.87198C4.407472 -5.87198 5.174595 -5.844085 5.453549 -5.244334Z' id='g0-99'/>
10+<path d='M1.239945 -0.751778L2.274859 -1.757402C3.797941 -3.104744 4.383742 -3.631964 4.383742 -4.608299C4.383742 -5.72132 3.505041 -6.502388 2.313913 -6.502388C1.210655 -6.502388 0.488167 -5.60416 0.488167 -4.735222C0.488167 -4.188475 0.976334 -4.188475 1.005625 -4.188475C1.171601 -4.188475 1.513318 -4.305635 1.513318 -4.705932C1.513318 -4.959779 1.337578 -5.213626 0.995861 -5.213626C0.917754 -5.213626 0.898228 -5.213626 0.868938 -5.203863C1.093495 -5.83848 1.620715 -6.199724 2.186989 -6.199724C3.075454 -6.199724 3.495277 -5.408893 3.495277 -4.608299C3.495277 -3.827231 3.00711 -3.055927 2.470126 -2.4506L0.595564 -0.361244C0.488167 -0.253847 0.488167 -0.23432 0.488167 0H4.110368L4.383742 -1.698822H4.139658C4.090841 -1.405922 4.022498 -0.976334 3.924865 -0.829884C3.856521 -0.751778 3.21214 -0.751778 2.997347 -0.751778H1.239945Z' id='g1-50'/>
11+</defs>
12+<g id='page1'>
13+<use x='56.413267' xlink:href='#g0-97' y='65.753425'/>
14+<use x='63.582369' xlink:href='#g1-50' y='60.691915'/>
15+<use x='72.061649' xlink:href='#g2-43' y='65.753425'/>
16+<use x='85.783204' xlink:href='#g0-98' y='65.753425'/>
17+<use x='91.589827' xlink:href='#g1-50' y='60.691915'/>
18+<use x='100.843973' xlink:href='#g2-61' y='65.753425'/>
19+<use x='115.340392' xlink:href='#g0-99' y='65.753425'/>
20+<use x='121.218045' xlink:href='#g1-50' y='60.691915'/>
21+</g>
22+</svg>
_images/math/a6a994cb6e7278ec30eaebe7e636046d3deccb5b.svgnew file+43
@@ -0,0 +1,43 @@
1+<?xml version='1.0' encoding='UTF-8'?>
2+<!-- This file was generated by dvisvgm 2.6.1 -->
3+<svg height='28.68903pt' version='1.1' viewBox='165.981071 78.308016 134.289458 28.68903' width='134.289458pt' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
4+<defs>
5+<path d='M3.807721 -3.249813C3.87746 -3.417186 3.87746 -3.445081 3.87746 -3.486924S3.87746 -3.556663 3.807721 -3.724035L1.366874 -10.139975C1.283188 -10.377086 1.199502 -10.460772 1.046077 -10.460772S0.767123 -10.335243 0.767123 -10.181818C0.767123 -10.139975 0.767123 -10.11208 0.836862 -9.958655L3.305604 -3.486924L0.836862 2.956912C0.767123 3.110336 0.767123 3.138232 0.767123 3.20797C0.767123 3.361395 0.892653 3.486924 1.046077 3.486924C1.227397 3.486924 1.283188 3.347447 1.338979 3.20797L3.807721 -3.249813Z' id='g1-105'/>
6+<path d='M2.217684 -9.958655C2.217684 -10.209714 2.217684 -10.460772 1.93873 -10.460772S1.659776 -10.209714 1.659776 -9.958655V2.984807C1.659776 3.235866 1.659776 3.486924 1.93873 3.486924S2.217684 3.235866 2.217684 2.984807V-9.958655Z' id='g1-106'/>
7+<path d='M6.555417 -9.344956C6.555417 -9.358904 6.611208 -9.540224 6.611208 -9.554172C6.611208 -9.679701 6.499626 -9.679701 6.457783 -9.679701C6.332254 -9.679701 6.318306 -9.609963 6.262516 -9.400747L3.961146 -0.167372C2.803487 -0.306849 2.371108 -0.892653 2.371108 -1.729514C2.371108 -2.036364 2.371108 -2.357161 3.02665 -4.086675C3.20797 -4.588792 3.277709 -4.770112 3.277709 -5.021171C3.277709 -5.648817 2.831382 -6.150934 2.175841 -6.150934C0.892653 -6.150934 0.376588 -4.128518 0.376588 -4.016936C0.376588 -3.961146 0.432379 -3.891407 0.530012 -3.891407C0.655542 -3.891407 0.669489 -3.947198 0.72528 -4.142466C1.060025 -5.355915 1.617933 -5.87198 2.133998 -5.87198C2.259527 -5.87198 2.496638 -5.858032 2.496638 -5.411706C2.496638 -5.355915 2.496638 -5.049066 2.259527 -4.435367C1.506351 -2.454795 1.506351 -2.147945 1.506351 -1.827148C1.506351 -0.488169 2.622167 0.027895 3.87746 0.125529C3.765878 0.557908 3.668244 1.004234 3.556663 1.436613C3.333499 2.273474 3.235866 2.66401 3.235866 2.719801C3.235866 2.84533 3.347447 2.84533 3.38929 2.84533C3.417186 2.84533 3.472976 2.84533 3.500872 2.789539C3.556663 2.733748 4.128518 0.390535 4.184309 0.139477C4.700374 0.139477 5.802242 0.139477 7.057534 -1.157659C7.517808 -1.659776 7.936239 -2.30137 8.17335 -2.901121C8.312827 -3.263761 8.647572 -4.505106 8.647572 -5.216438C8.647572 -6.0533 8.229141 -6.150934 8.089664 -6.150934C7.754919 -6.150934 7.44807 -5.816189 7.44807 -5.537235C7.44807 -5.369863 7.545704 -5.272229 7.601494 -5.216438C7.727024 -5.090909 8.103611 -4.714321 8.103611 -3.989041C8.103611 -3.486924 7.824658 -2.454795 6.932005 -1.45056C5.760399 -0.139477 4.686426 -0.139477 4.267995 -0.139477L6.555417 -9.344956Z' id='g2-32'/>
8+<path d='M2.566376 -0.669489C2.566376 -1.073973 2.231631 -1.352927 1.896887 -1.352927C1.492403 -1.352927 1.21345 -1.018182 1.21345 -0.683437C1.21345 -0.278954 1.548194 0 1.882939 0C2.287422 0 2.566376 -0.334745 2.566376 -0.669489Z' id='g2-58'/>
9+<path d='M6.332254 -4.658531C6.248568 -5.439601 5.760399 -6.374097 4.505106 -6.374097C2.538481 -6.374097 0.530012 -4.379577 0.530012 -2.161893C0.530012 -1.311083 1.115816 0.292902 3.012702 0.292902C6.304359 0.292902 7.713076 -4.505106 7.713076 -6.41594C7.713076 -8.424408 6.583313 -9.972603 4.798007 -9.972603C2.775592 -9.972603 2.175841 -8.201245 2.175841 -7.824658C2.175841 -7.699128 2.259527 -7.392279 2.650062 -7.392279C3.138232 -7.392279 3.347447 -7.838605 3.347447 -8.075716C3.347447 -8.508095 2.915068 -8.508095 2.733748 -8.508095C3.305604 -9.540224 4.365629 -9.637858 4.742217 -9.637858C5.969614 -9.637858 6.750685 -8.661519 6.750685 -7.099377C6.750685 -6.206725 6.485679 -5.174595 6.346202 -4.658531H6.332254ZM3.054545 -0.083686C1.743462 -0.083686 1.520299 -1.115816 1.520299 -1.701619C1.520299 -2.315318 1.910834 -3.75193 2.12005 -4.267995C2.30137 -4.686426 3.096389 -6.095143 4.546949 -6.095143C5.816189 -6.095143 6.109091 -4.993275 6.109091 -4.2401C6.109091 -3.20797 5.202491 -0.083686 3.054545 -0.083686Z' id='g2-64'/>
10+<path d='M10.432877 -8.508095C10.558406 -8.982316 10.586301 -9.121793 11.576588 -9.121793C11.827646 -9.121793 11.967123 -9.121793 11.967123 -9.372852C11.967123 -9.526276 11.841594 -9.526276 11.757908 -9.526276C11.506849 -9.526276 11.213948 -9.498381 10.948941 -9.498381H9.303113C9.038107 -9.498381 8.745205 -9.526276 8.480199 -9.526276C8.382565 -9.526276 8.215193 -9.526276 8.215193 -9.26127C8.215193 -9.121793 8.312827 -9.121793 8.577833 -9.121793C9.414695 -9.121793 9.414695 -9.010212 9.414695 -8.856787C9.414695 -8.828892 9.414695 -8.745205 9.358904 -8.53599L8.508095 -5.160648H4.29589L5.132752 -8.508095C5.258281 -8.982316 5.286177 -9.121793 6.276463 -9.121793C6.527522 -9.121793 6.666999 -9.121793 6.666999 -9.372852C6.666999 -9.526276 6.541469 -9.526276 6.457783 -9.526276C6.206725 -9.526276 5.913823 -9.498381 5.648817 -9.498381H4.002989C3.737983 -9.498381 3.445081 -9.526276 3.180075 -9.526276C3.082441 -9.526276 2.915068 -9.526276 2.915068 -9.26127C2.915068 -9.121793 3.012702 -9.121793 3.277709 -9.121793C4.11457 -9.121793 4.11457 -9.010212 4.11457 -8.856787C4.11457 -8.828892 4.11457 -8.745205 4.05878 -8.53599L2.175841 -1.03213C2.050311 -0.54396 2.022416 -0.404483 1.060025 -0.404483C0.739228 -0.404483 0.641594 -0.404483 0.641594 -0.139477C0.641594 0 0.795019 0 0.836862 0C1.08792 0 1.380822 -0.027895 1.645828 -0.027895H3.291656C3.556663 -0.027895 3.849564 0 4.11457 0C4.226152 0 4.379577 0 4.379577 -0.265006C4.379577 -0.404483 4.254047 -0.404483 4.044832 -0.404483C3.194022 -0.404483 3.194022 -0.516065 3.194022 -0.655542C3.194022 -0.669489 3.194022 -0.767123 3.221918 -0.878705L4.184309 -4.756164H8.410461C8.17335 -3.835616 7.462017 -0.920548 7.434122 -0.836862C7.280697 -0.418431 7.057534 -0.418431 6.23462 -0.404483C6.067248 -0.404483 5.941719 -0.404483 5.941719 -0.139477C5.941719 0 6.095143 0 6.136986 0C6.388045 0 6.680946 -0.027895 6.945953 -0.027895H8.591781C8.856787 -0.027895 9.149689 0 9.414695 0C9.526276 0 9.679701 0 9.679701 -0.265006C9.679701 -0.404483 9.554172 -0.404483 9.344956 -0.404483C8.494147 -0.404483 8.494147 -0.516065 8.494147 -0.655542C8.494147 -0.669489 8.494147 -0.767123 8.522042 -0.878705L10.432877 -8.508095Z' id='g2-72'/>
11+<path d='M2.803487 -5.606974H4.086675C4.351681 -5.606974 4.491158 -5.606974 4.491158 -5.858032C4.491158 -6.011457 4.407472 -6.011457 4.128518 -6.011457H2.901121L3.417186 -8.047821C3.472976 -8.243088 3.472976 -8.270984 3.472976 -8.368618C3.472976 -8.591781 3.291656 -8.71731 3.110336 -8.71731C2.998755 -8.71731 2.677958 -8.675467 2.566376 -8.229141L2.022416 -6.011457H0.711333C0.432379 -6.011457 0.306849 -6.011457 0.306849 -5.746451C0.306849 -5.606974 0.404483 -5.606974 0.669489 -5.606974H1.910834L0.990286 -1.924782C0.878705 -1.436613 0.836862 -1.297136 0.836862 -1.115816C0.836862 -0.460274 1.297136 0.139477 2.078207 0.139477C3.486924 0.139477 4.2401 -1.896887 4.2401 -1.994521C4.2401 -2.078207 4.184309 -2.12005 4.100623 -2.12005C4.072727 -2.12005 4.016936 -2.12005 3.989041 -2.064259C3.975093 -2.050311 3.961146 -2.036364 3.863512 -1.8132C3.57061 -1.115816 2.929016 -0.139477 2.12005 -0.139477C1.701619 -0.139477 1.673724 -0.488169 1.673724 -0.795019C1.673724 -0.808966 1.673724 -1.073973 1.715567 -1.241345L2.803487 -5.606974Z' id='g2-116'/>
12+<path d='M4.533001 3.38929C4.533001 3.347447 4.533001 3.319552 4.29589 3.082441C2.901121 1.673724 2.12005 -0.627646 2.12005 -3.472976C2.12005 -6.178829 2.775592 -8.508095 4.393524 -10.153923C4.533001 -10.279452 4.533001 -10.307347 4.533001 -10.349191C4.533001 -10.432877 4.463263 -10.460772 4.407472 -10.460772C4.226152 -10.460772 3.082441 -9.456538 2.399004 -8.089664C1.687671 -6.680946 1.366874 -5.188543 1.366874 -3.472976C1.366874 -2.231631 1.562142 -0.571856 2.287422 0.920548C3.110336 2.594271 4.254047 3.500872 4.407472 3.500872C4.463263 3.500872 4.533001 3.472976 4.533001 3.38929Z' id='g3-40'/>
13+<path d='M3.93325 -3.472976C3.93325 -4.533001 3.793773 -6.262516 3.012702 -7.880448C2.189788 -9.554172 1.046077 -10.460772 0.892653 -10.460772C0.836862 -10.460772 0.767123 -10.432877 0.767123 -10.349191C0.767123 -10.307347 0.767123 -10.279452 1.004234 -10.042341C2.399004 -8.633624 3.180075 -6.332254 3.180075 -3.486924C3.180075 -0.781071 2.524533 1.548194 0.9066 3.194022C0.767123 3.319552 0.767123 3.347447 0.767123 3.38929C0.767123 3.472976 0.836862 3.500872 0.892653 3.500872C1.073973 3.500872 2.217684 2.496638 2.901121 1.129763C3.612453 -0.292902 3.93325 -1.799253 3.93325 -3.472976Z' id='g3-41'/>
14+<path d='M9.414695 -4.519054C9.609963 -4.519054 9.861021 -4.519054 9.861021 -4.770112C9.861021 -5.035118 9.62391 -5.035118 9.414695 -5.035118H1.199502C1.004234 -5.035118 0.753176 -5.035118 0.753176 -4.78406C0.753176 -4.519054 0.990286 -4.519054 1.199502 -4.519054H9.414695ZM9.414695 -1.924782C9.609963 -1.924782 9.861021 -1.924782 9.861021 -2.175841C9.861021 -2.440847 9.62391 -2.440847 9.414695 -2.440847H1.199502C1.004234 -2.440847 0.753176 -2.440847 0.753176 -2.189788C0.753176 -1.924782 0.990286 -1.924782 1.199502 -1.924782H9.414695Z' id='g3-61'/>
15+<path d='M3.417186 -9.679701L1.590037 -7.782814L1.8132 -7.573599L3.403238 -9.010212L5.007223 -7.573599L5.230386 -7.782814L3.417186 -9.679701Z' id='g3-94'/>
16+<path d='M2.426899 -8.591781C2.426899 -8.954421 2.133998 -9.275218 1.743462 -9.275218C1.380822 -9.275218 1.073973 -8.982316 1.073973 -8.605729C1.073973 -8.187298 1.408717 -7.922291 1.743462 -7.922291C2.175841 -7.922291 2.426899 -8.284932 2.426899 -8.591781ZM0.502117 -5.997509V-5.593026C1.39477 -5.593026 1.520299 -5.50934 1.520299 -4.825903V-1.03213C1.520299 -0.404483 1.366874 -0.404483 0.460274 -0.404483V0C0.850809 -0.027895 1.520299 -0.027895 1.924782 -0.027895C2.078207 -0.027895 2.887173 -0.027895 3.361395 0V-0.404483C2.454795 -0.404483 2.399004 -0.474222 2.399004 -1.018182V-6.150934L0.502117 -5.997509Z' id='g3-105'/>
17+<path d='M3.556663 -7.671233H6.262516C6.499626 -7.671233 6.653051 -7.671233 6.653051 -7.838605C6.653051 -8.019925 6.485679 -8.019925 6.220672 -8.019925H3.640349C3.737983 -8.368618 3.737983 -8.396513 3.821669 -8.745205C3.891407 -8.996264 4.016936 -9.484433 4.016936 -9.512329C4.016936 -9.637858 3.93325 -9.679701 3.821669 -9.679701C3.556663 -9.679701 2.454795 -9.56812 2.12005 -9.540224C2.008468 -9.526276 1.855044 -9.512329 1.855044 -9.247323C1.855044 -9.093898 1.994521 -9.093898 2.189788 -9.093898C2.859278 -9.093898 2.887173 -8.996264 2.887173 -8.856787C2.887173 -8.759153 2.761644 -8.298879 2.691905 -8.019925H1.910834C1.63188 -8.019925 1.478456 -8.019925 1.478456 -7.838605C1.478456 -7.671233 1.603985 -7.671233 1.868991 -7.671233H2.608219L0.822914 -0.557908C0.767123 -0.348692 0.767123 -0.320797 0.767123 -0.237111C0.767123 0.069738 1.004234 0.153425 1.171606 0.153425C1.436613 0.153425 1.63188 -0.041843 1.687671 -0.223163C1.715567 -0.292902 1.868991 -0.920548 1.952677 -1.26924L2.273474 -2.510585C2.315318 -2.719801 2.454795 -3.249813 2.496638 -3.459029C2.566376 -3.682192 2.66401 -4.11457 2.677958 -4.156413C2.789539 -4.393524 3.542715 -5.858032 4.937484 -5.858032C5.551183 -5.858032 5.69066 -5.355915 5.69066 -4.895641C5.69066 -4.030884 5.049066 -2.329265 4.798007 -1.687671C4.714321 -1.464508 4.644583 -1.26924 4.644583 -1.004234C4.644583 -0.278954 5.160648 0.153425 5.788294 0.153425C7.127273 0.153425 7.615442 -1.910834 7.615442 -1.994521C7.615442 -2.133998 7.489913 -2.133998 7.44807 -2.133998C7.308593 -2.133998 7.308593 -2.092154 7.238854 -1.882939C6.834371 -0.460274 6.206725 -0.153425 5.830137 -0.153425C5.565131 -0.153425 5.481445 -0.320797 5.481445 -0.613699C5.481445 -0.962391 5.634869 -1.352927 5.718555 -1.590037C5.955666 -2.203736 6.583313 -3.87746 6.583313 -4.658531C6.583313 -5.676712 5.941719 -6.164882 4.979328 -6.164882C4.546949 -6.164882 3.710087 -6.067248 2.915068 -5.104857L3.556663 -7.671233Z' id='g0-126'/>
18+</defs>
19+<g id='page1'>
20+<use x='165.981071' xlink:href='#g3-105' y='97.429622'/>
21+<use x='169.774676' xlink:href='#g0-126' y='97.429622'/>
22+<use x='180.971707' xlink:href='#g2-64' y='87.993906'/>
23+<rect height='0.55789' width='12.899852' x='178.505856' y='93.663745'/>
24+<use x='178.505856' xlink:href='#g2-64' y='106.997046'/>
25+<use x='186.474036' xlink:href='#g2-116' y='106.997046'/>
26+<use x='192.601222' xlink:href='#g1-106' y='97.429622'/>
27+<use x='198.80019' xlink:href='#g2-32' y='97.429622'/>
28+<use x='208.179277' xlink:href='#g3-40' y='97.429622'/>
29+<use x='213.490324' xlink:href='#g2-116' y='97.429622'/>
30+<use x='218.42201' xlink:href='#g3-41' y='97.429622'/>
31+<use x='223.733057' xlink:href='#g1-105' y='97.429622'/>
32+<use x='233.031506' xlink:href='#g3-61' y='97.429622'/>
33+<use x='251.068923' xlink:href='#g3-94' y='93.903964'/>
34+<use x='247.527926' xlink:href='#g2-72' y='97.429622'/>
35+<use x='259.920966' xlink:href='#g1-106' y='97.429622'/>
36+<use x='266.119934' xlink:href='#g2-32' y='97.429622'/>
37+<use x='275.499021' xlink:href='#g3-40' y='97.429622'/>
38+<use x='280.810068' xlink:href='#g2-116' y='97.429622'/>
39+<use x='285.741754' xlink:href='#g3-41' y='97.429622'/>
40+<use x='291.052801' xlink:href='#g1-105' y='97.429622'/>
41+<use x='296.476924' xlink:href='#g2-58' y='97.429622'/>
42+</g>
43+</svg>
_images/svg_image.svgnew file+10
@@ -0,0 +1,10 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<!-- originate: https://commons.wikimedia.org/wiki/File:Variable_Resistor.svg -->
3+<svg xmlns="http://www.w3.org/2000/svg"
4+ version="1.1" baseProfile="full"
5+ width="70px" height="40px" viewBox="0 0 700 400">
6+ <line x1="0" y1="200" x2="700" y2="200" stroke="black" stroke-width="20px"/>
7+ <rect x="100" y="100" width="500" height="200" fill="white" stroke="black" stroke-width="20px"/>
8+ <line x1="180" y1="370" x2="500" y2="50" stroke="black" stroke-width="15px"/>
9+ <polygon points="585 0 525 25 585 50" transform="rotate(135 525 25)"/>
10+</svg>
_sources/admin/api.rst.txtnew file+96
@@ -0,0 +1,96 @@
1+.. _adminapi:
2+
3+==================
4+Administration API
5+==================
6+
7+Get configuration data
8+======================
9+
10+.. code:: http
11+
12+ GET /config HTTP/1.1
13+
14+Sample response
15+---------------
16+
17+.. code:: json
18+
19+ {
20+ "autocomplete": "",
21+ "categories": [
22+ "map",
23+ "it",
24+ "images",
25+ ],
26+ "default_locale": "",
27+ "default_theme": "oscar",
28+ "engines": [
29+ {
30+ "categories": [
31+ "map"
32+ ],
33+ "enabled": true,
34+ "name": "openstreetmap",
35+ "shortcut": "osm"
36+ },
37+ {
38+ "categories": [
39+ "it"
40+ ],
41+ "enabled": true,
42+ "name": "arch linux wiki",
43+ "shortcut": "al"
44+ },
45+ {
46+ "categories": [
47+ "images"
48+ ],
49+ "enabled": true,
50+ "name": "google images",
51+ "shortcut": "goi"
52+ },
53+ {
54+ "categories": [
55+ "it"
56+ ],
57+ "enabled": false,
58+ "name": "bitbucket",
59+ "shortcut": "bb"
60+ },
61+ ],
62+ "instance_name": "searx",
63+ "locales": {
64+ "de": "Deutsch (German)",
65+ "en": "English",
66+ "eo": "Esperanto (Esperanto)",
67+ },
68+ "plugins": [
69+ {
70+ "enabled": true,
71+ "name": "HTTPS rewrite"
72+ },
73+ {
74+ "enabled": false,
75+ "name": "Vim-like hotkeys"
76+ }
77+ ],
78+ "safe_search": 0
79+ }
80+
81+
82+Embed search bar
83+================
84+
85+The search bar can be embedded into websites. Just paste the example into the
86+HTML of the site. URL of the searx instance and values are customizable.
87+
88+.. code:: html
89+
90+ <form method="post" action="https://searx.me/">
91+ <!-- search --> <input type="text" name="q" />
92+ <!-- categories --> <input type="hidden" name="categories" value="general,social media" />
93+ <!-- language --> <input type="hidden" name="lang" value="all" />
94+ <!-- locale --> <input type="hidden" name="locale" value="en" />
95+ <!-- date filter --> <input type="hidden" name="time_range" value="month" />
96+ </form>
_sources/admin/api.txtdeleted−94
@@ -1,94 +0,0 @@
1−.. _adminapi:
2−
3−Administration API
4−------------------
5−
6−Get configuration data
7−~~~~~~~~~~~~~~~~~~~~~~
8−
9−.. code:: sh
10−
11− GET /config
12−
13−Sample response
14−```````````````
15−
16−.. code:: sh
17−
18− {
19− "autocomplete": "",
20− "categories": [
21− "map",
22− "it",
23− "images",
24− ],
25− "default_locale": "",
26− "default_theme": "oscar",
27− "engines": [
28− {
29− "categories": [
30− "map"
31− ],
32− "enabled": true,
33− "name": "openstreetmap",
34− "shortcut": "osm"
35− },
36− {
37− "categories": [
38− "it"
39− ],
40− "enabled": true,
41− "name": "arch linux wiki",
42− "shortcut": "al"
43− },
44− {
45− "categories": [
46− "images"
47− ],
48− "enabled": true,
49− "name": "google images",
50− "shortcut": "goi"
51− },
52− {
53− "categories": [
54− "it"
55− ],
56− "enabled": false,
57− "name": "bitbucket",
58− "shortcut": "bb"
59− },
60− ],
61− "instance_name": "searx",
62− "locales": {
63− "de": "Deutsch (German)",
64− "en": "English",
65− "eo": "Esperanto (Esperanto)",
66− },
67− "plugins": [
68− {
69− "enabled": true,
70− "name": "HTTPS rewrite"
71− },
72− {
73− "enabled": false,
74− "name": "Vim-like hotkeys"
75− }
76− ],
77− "safe_search": 0
78− }
79−
80−Embed search bar
81−----------------
82−
83−The search bar can be embedded into websites. Just paste the example into the HTML of the site.
84−URL of the searx instance and values are customizable.
85−
86−.. code:: html
87−
88− <form method="post" action="https://searx.me/">
89− <!-- search query --> <input type="text" name="q" />
90− <!-- categories --> <input type="hidden" name="categories" value="general,social media" />
91− <!-- language --> <input type="hidden" name="lang" value="all" />
92− <!-- locale --> <input type="hidden" name="locale" value="en" />
93− <!-- date filter --> <input type="hidden" name="time_range" value="month" />
94− </form>
_sources/admin/architecture.rst.txtnew file+24
@@ -0,0 +1,24 @@
1+.. _architecture:
2+
3+============
4+Architecture
5+============
6+
7+.. sidebar:: Needs work!
8+
9+ This article needs some work / Searx is a collaborative effort. If you have
10+ any contribution, feel welcome to send us your :pull:`PR <../pulls>`, see
11+ :ref:`how to contribute`.
12+
13+Herein you will find some hints and suggestions about typical architectures of
14+searx infrastructures.
15+
16+We start with a contribution from :pull:`@dalf <1776#issuecomment-567917320>`.
17+It shows a *reference* setup for public searx instances.
18+
19+.. _arch public:
20+
21+.. kernel-figure:: arch_public.dot
22+ :alt: arch_public.dot
23+
24+ Reference architecture of a public searx setup.
_sources/admin/buildhosts.rst.txtnew 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+
_sources/admin/engines.rst.txtnew file+68
@@ -0,0 +1,68 @@
1+.. _engines generic:
2+
3+=======
4+engines
5+=======
6+
7+.. sidebar:: Further reading ..
8+
9+ - :ref:`engines generic`
10+ - :ref:`configured engines`
11+ - :ref:`engine settings`
12+ - :ref:`engine file`
13+
14+============= =========== ==================== ============
15+:ref:`engine settings` :ref:`engine file`
16+------------------------- ---------------------------------
17+Name (cfg) Categories
18+------------------------- ---------------------------------
19+Engine .. Paging support **P**
20+------------------------- -------------------- ------------
21+Shortcut **S** Language support **L**
22+Timeout **TO** Time range support **TR**
23+Disabled **D** Offline **O**
24+------------- ----------- -------------------- ------------
25+Suspend end **SE**
26+------------- ----------- ---------------------------------
27+Safe search **SS**
28+============= =========== =================================
29+
30+Configuration defaults (at built time):
31+
32+.. _configured engines:
33+
34+.. jinja:: webapp
35+
36+ .. flat-table:: Engines configured at built time (defaults)
37+ :header-rows: 1
38+ :stub-columns: 2
39+
40+ * - Name (cfg)
41+ - S
42+ - Engine
43+ - TO
44+ - Categories
45+ - P
46+ - L
47+ - SS
48+ - D
49+ - TR
50+ - O
51+ - SE
52+
53+ {% for name, mod in engines.items() %}
54+
55+ * - {{name}}
56+ - !{{mod.shortcut}}
57+ - {{mod.__name__}}
58+ - {{mod.timeout}}
59+ - {{", ".join(mod.categories)}}
60+ - {{(mod.paging and "y") or ""}}
61+ - {{(mod.language_support and "y") or ""}}
62+ - {{(mod.safesearch and "y") or ""}}
63+ - {{(mod.disabled and "y") or ""}}
64+ - {{(mod.time_range_support and "y") or ""}}
65+ - {{(mod.offline and "y") or ""}}
66+ - {{mod.suspend_end_time}}
67+
68+ {% endfor %}
_sources/admin/filtron.rst.txtnew file+148
@@ -0,0 +1,148 @@
1+==========================
2+How to protect an instance
3+==========================
4+
5+Searx depens on external search services. To avoid the abuse of these services
6+it is advised to limit the number of requests processed by searx.
7+
8+An application firewall, ``filtron`` solves exactly this problem. Information
9+on how to install it can be found at the `project page of filtron
10+<https://github.com/asciimoo/filtron>`__.
11+
12+
13+Sample configuration of filtron
14+===============================
15+
16+An example configuration can be find below. This configuration limits the access
17+of:
18+
19+- scripts or applications (roboagent limit)
20+- webcrawlers (botlimit)
21+- IPs which send too many requests (IP limit)
22+- too many json, csv, etc. requests (rss/json limit)
23+- the same UserAgent of if too many requests (useragent limit)
24+
25+.. code:: json
26+
27+ [{
28+ "name":"search request",
29+ "filters":[
30+ "Param:q",
31+ "Path=^(/|/search)$"
32+ ],
33+ "interval":"<time-interval-in-sec (int)>",
34+ "limit":"<max-request-number-in-interval (int)>",
35+ "subrules":[
36+ {
37+ "name":"roboagent limit",
38+ "interval":"<time-interval-in-sec (int)>",
39+ "limit":"<max-request-number-in-interval (int)>",
40+ "filters":[
41+ "Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"
42+ ],
43+ "actions":[
44+ {
45+ "name":"block",
46+ "params":{
47+ "message":"Rate limit exceeded"
48+ }
49+ }
50+ ]
51+ },
52+ {
53+ "name":"botlimit",
54+ "limit":0,
55+ "stop":true,
56+ "filters":[
57+ "Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"
58+ ],
59+ "actions":[
60+ {
61+ "name":"block",
62+ "params":{
63+ "message":"Rate limit exceeded"
64+ }
65+ }
66+ ]
67+ },
68+ {
69+ "name":"IP limit",
70+ "interval":"<time-interval-in-sec (int)>",
71+ "limit":"<max-request-number-in-interval (int)>",
72+ "stop":true,
73+ "aggregations":[
74+ "Header:X-Forwarded-For"
75+ ],
76+ "actions":[
77+ {
78+ "name":"block",
79+ "params":{
80+ "message":"Rate limit exceeded"
81+ }
82+ }
83+ ]
84+ },
85+ {
86+ "name":"rss/json limit",
87+ "interval":"<time-interval-in-sec (int)>",
88+ "limit":"<max-request-number-in-interval (int)>",
89+ "stop":true,
90+ "filters":[
91+ "Param:format=(csv|json|rss)"
92+ ],
93+ "actions":[
94+ {
95+ "name":"block",
96+ "params":{
97+ "message":"Rate limit exceeded"
98+ }
99+ }
100+ ]
101+ },
102+ {
103+ "name":"useragent limit",
104+ "interval":"<time-interval-in-sec (int)>",
105+ "limit":"<max-request-number-in-interval (int)>",
106+ "aggregations":[
107+ "Header:User-Agent"
108+ ],
109+ "actions":[
110+ {
111+ "name":"block",
112+ "params":{
113+ "message":"Rate limit exceeded"
114+ }
115+ }
116+ ]
117+ }
118+ ]
119+ }]
120+
121+
122+
123+Route request through filtron
124+=============================
125+
126+Filtron can be started using the following command:
127+
128+.. code:: sh
129+
130+ $ filtron -rules rules.json
131+
132+It listens on ``127.0.0.1:4004`` and forwards filtered requests to
133+``127.0.0.1:8888`` by default.
134+
135+Use it along with ``nginx`` with the following example configuration.
136+
137+.. code:: nginx
138+
139+ location / {
140+ proxy_set_header Host $http_host;
141+ proxy_set_header X-Real-IP $remote_addr;
142+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
143+ proxy_set_header X-Scheme $scheme;
144+ proxy_pass http://127.0.0.1:4004/;
145+ }
146+
147+Requests are coming from port 4004 going through filtron and then forwarded to
148+port 8888 where a searx is being run.
_sources/admin/filtron.txtdeleted−114
@@ -1,114 +0,0 @@
1−How to protect an instance
2−==========================
3−
4−Searx depens on external search services. To avoid the abuse of these services it is advised to limit the number of requests processed by searx.
5−
6−An application firewall, ``filtron`` solves exactly this problem. Information on how to install it can be found at the `project page of filtron <https://github.com/asciimoo/filtron>`__.
7−
8−Sample configuration of filtron
9−-------------------------------
10−
11−An example configuration can be find below. This configuration limits the access of
12−
13− * scripts or applications (roboagent limit)
14−
15− * webcrawlers (botlimit)
16−
17− * IPs which send too many requests (IP limit)
18−
19− * too many json, csv, etc. requests (rss/json limit)
20−
21− * the same UserAgent of if too many requests (useragent limit)
22−
23−
24−.. code:: json
25−
26− [
27− {
28− "name": "search request",
29− "filters": ["Param:q", "Path=^(/|/search)$"],
30− "interval": <time-interval-in-sec>,
31− "limit": <max-request-number-in-interval>,
32− "subrules": [
33− {
34− "name": "roboagent limit",
35− "interval": <time-interval-in-sec>,
36− "limit": <max-request-number-in-interval>,
37− "filters": ["Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"],
38− "actions": [
39− {"name": "block",
40− "params": {"message": "Rate limit exceeded"}}
41− ]
42− },
43− {
44− "name": "botlimit",
45− "limit": 0,
46− "stop": true,
47− "filters": ["Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"],
48− "actions": [
49− {"name": "block",
50− "params": {"message": "Rate limit exceeded"}}
51− ]
52− },
53− {
54− "name": "IP limit",
55− "interval": <time-interval-in-sec>,
56− "limit": <max-request-number-in-interval>,
57− "stop": true,
58− "aggregations": ["Header:X-Forwarded-For"],
59− "actions": [
60− {"name": "block",
61− "params": {"message": "Rate limit exceeded"}}
62− ]
63− },
64− {
65− "name": "rss/json limit",
66− "interval": <time-interval-in-sec>,
67− "limit": <max-request-number-in-interval>,
68− "stop": true,
69− "filters": ["Param:format=(csv|json|rss)"],
70− "actions": [
71− {"name": "block",
72− "params": {"message": "Rate limit exceeded"}}
73− ]
74− },
75− {
76− "name": "useragent limit",
77− "interval": <time-interval-in-sec>,
78− "limit": <max-request-number-in-interval>,
79− "aggregations": ["Header:User-Agent"],
80− "actions": [
81− {"name": "block",
82− "params": {"message": "Rate limit exceeded"}}
83− ]
84− }
85− ]
86− }
87− ]
88−
89−
90−
91−Route request through filtron
92−-----------------------------
93−
94−Filtron can be started using the following command:
95−
96−.. code:: bash
97−
98− $ filtron -rules rules.json
99−
100−It listens on 127.0.0.1:4004 and forwards filtered requests to 127.0.0.1:8888 by default.
101−
102−Use it along with ``nginx`` with the following example configuration.
103−
104−.. code:: bash
105−
106− location / {
107− proxy_set_header Host $http_host;
108− proxy_set_header X-Real-IP $remote_addr;
109− proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
110− proxy_set_header X-Scheme $scheme;
111− proxy_pass http://127.0.0.1:4004/;
112− }
113−
114−Requests are coming from port 4004 going through filtron and then forwarded to port 8888 where a searx is being run.
_sources/admin/index.rst.txtnew file+15
@@ -0,0 +1,15 @@
1+===========================
2+Administrator documentation
3+===========================
4+
5+.. toctree::
6+ :maxdepth: 1
7+
8+ installation
9+ api
10+ architecture
11+ filtron
12+ morty
13+ engines
14+ plugins
15+ buildhosts
docs/dev/install/installation.rst → _sources/admin/installation.rst.txtrenamed+84−72
@@ -1,5 +1,6 @@
11.. _installation:
22
3+============
34Installation
45============
56
@@ -7,37 +8,44 @@ Installation
78 :depth: 3
89
910Basic installation
10−------------------
11+==================
1112
12−Step by step installation for Debian/Ubuntu with virtualenv. For Ubuntu, be sure to have enable universe repository.
13+Step by step installation for Debian/Ubuntu with virtualenv. For Ubuntu, be sure
14+to have enable universe repository.
1315
1416Install packages:
1517
1618.. code:: sh
1719
18− sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-babel zlib1g-dev libffi-dev libssl-dev
20+ $ sudo -H apt-get install \
21+ git build-essential libxslt-dev \
22+ python-dev python-virtualenv python-babel \
23+ zlib1g-dev libffi-dev libssl-dev
1924
2025Install searx:
2126
2227.. code:: sh
2328
2429 cd /usr/local
25− sudo git clone https://github.com/asciimoo/searx.git
26− sudo useradd searx -d /usr/local/searx
27− sudo chown searx:searx -R /usr/local/searx
30+ sudo -H git clone https://github.com/asciimoo/searx.git
31+ sudo -H useradd searx -d /usr/local/searx
32+ sudo -H chown searx:searx -R /usr/local/searx
2833
2934Install dependencies in a virtualenv:
3035
3136.. code:: sh
3237
33− sudo -u searx -i
3438 cd /usr/local/searx
35− virtualenv searx-ve
36− . ./searx-ve/bin/activate
37− ./manage.sh update_packages
39+ sudo -H -u searx -i
40+
41+.. code:: sh
42+
43+ (searx)$ virtualenv searx-ve
44+ (searx)$ . ./searx-ve/bin/activate
45+ (searx)$ ./manage.sh update_packages
3846
3947Configuration
40−-------------
48+==============
4149
4250.. code:: sh
4351
@@ -46,7 +54,7 @@ Configuration
4654Edit searx/settings.yml if necessary.
4755
4856Check
49−-----
57+=====
5058
5159Start searx:
5260
@@ -68,18 +76,19 @@ You can exit the virtualenv and the searx user bash (enter exit command
6876twice).
6977
7078uwsgi
71−-----
79+=====
7280
7381Install packages:
7482
7583.. code:: sh
7684
77− sudo apt-get install uwsgi uwsgi-plugin-python
85+ sudo -H apt-get install \
86+ uwsgi uwsgi-plugin-python
7887
79−Create the configuration file /etc/uwsgi/apps-available/searx.ini with
80−this content:
88+Create the configuration file ``/etc/uwsgi/apps-available/searx.ini`` with this
89+content:
8190
82−::
91+.. code:: ini
8392
8493 [uwsgi]
8594 # Who will run the code
@@ -119,22 +128,22 @@ Activate the uwsgi application and restart:
119128 /etc/init.d/uwsgi restart
120129
121130Web server
122−----------
131+==========
123132
124133with nginx
125−^^^^^^^^^^
134+----------
126135
127136If nginx is not installed (uwsgi will not work with the package
128137nginx-light):
129138
130139.. code:: sh
131140
132− sudo apt-get install nginx
141+ sudo -H apt-get install nginx
133142
134143Hosted at /
135−"""""""""""
144+~~~~~~~~~~~
136145
137−Create the configuration file /etc/nginx/sites-available/searx with this
146+Create the configuration file ``/etc/nginx/sites-available/searx`` with this
138147content:
139148
140149.. code:: nginx
@@ -154,20 +163,20 @@ Create a symlink to sites-enabled:
154163
155164.. code:: sh
156165
157− sudo ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx
166+ sudo -H ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx
158167
159168Restart service:
160169
161170.. code:: sh
162171
163− sudo service nginx restart
164− sudo service uwsgi restart
172+ sudo -H service nginx restart
173+ sudo -H service uwsgi restart
165174
166175from subdirectory URL (/searx)
167−""""""""""""""""""""""""""""""
176+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168177
169178Add this configuration in the server config file
170−/etc/nginx/sites-enabled/default:
179+``/etc/nginx/sites-enabled/default``:
171180
172181.. code:: nginx
173182
@@ -183,10 +192,8 @@ Add this configuration in the server config file
183192 }
184193
185194
186−OR
187−
188−using reverse proxy
189−(Please, note that reverse proxy advised to be used in case of single-user or low-traffic instances.)
195+**OR** using reverse proxy (Please, note that reverse proxy advised to be used
196+in case of single-user or low-traffic instances.)
190197
191198.. code:: nginx
192199
@@ -200,9 +207,9 @@ using reverse proxy
200207 }
201208
202209
203−Enable base\_url in searx/settings.yml
210+Enable ``base_url`` in ``searx/settings.yml``
204211
205−::
212+.. code:: yaml
206213
207214 base_url : http://your.domain.tld/searx/
208215
@@ -210,18 +217,18 @@ Restart service:
210217
211218.. code:: sh
212219
213− sudo service nginx restart
214− sudo service uwsgi restart
220+ sudo -H service nginx restart
221+ sudo -H service uwsgi restart
215222
216223disable logs
217−~~~~~~~~~~~~
224+^^^^^^^^^^^^
218225
219226for better privacy you can disable nginx logs about searx.
220227
221−how to proceed: below ``uwsgi_pass`` in
222−/etc/nginx/sites-available/default add
228+how to proceed: below ``uwsgi_pass`` in ``/etc/nginx/sites-available/default``
229+add:
223230
224−::
231+.. code:: nginx
225232
226233 access_log /dev/null;
227234 error_log /dev/null;
@@ -230,19 +237,19 @@ Restart service:
230237
231238.. code:: sh
232239
233− sudo service nginx restart
240+ sudo -H service nginx restart
234241
235242with apache
236−^^^^^^^^^^^
243+-----------
237244
238245Add wsgi mod:
239246
240247.. code:: sh
241248
242− sudo apt-get install libapache2-mod-uwsgi
243− sudo a2enmod uwsgi
249+ sudo -H apt-get install libapache2-mod-uwsgi
250+ sudo -H a2enmod uwsgi
244251
245−Add this configuration in the file /etc/apache2/apache2.conf:
252+Add this configuration in the file ``/etc/apache2/apache2.conf``:
246253
247254.. code:: apache
248255
@@ -252,27 +259,26 @@ Add this configuration in the file /etc/apache2/apache2.conf:
252259 uWSGISocket /run/uwsgi/app/searx/socket
253260 </Location>
254261
255−Note that if your instance of searx is not at the root, you should
256−change ``<Location />`` by the location of your instance, like
257−``<Location /searx>``.
262+Note that if your instance of searx is not at the root, you should change
263+``<Location />`` by the location of your instance, like ``<Location /searx>``.
258264
259265Restart Apache:
260266
261267.. code:: sh
262268
263− sudo /etc/init.d/apache2 restart
269+ sudo -H /etc/init.d/apache2 restart
264270
265271disable logs
266−""""""""""""
272+~~~~~~~~~~~~
267273
268274For better privacy you can disable Apache logs.
269275
270−WARNING: not tested
276+.. warning::
271277
272−WARNING: you can only disable logs for the whole (virtual) server not
273−for a specific path.
278+ You can only disable logs for the whole (virtual) server not for a specific
279+ path.
274280
275−Go back to /etc/apache2/apache2.conf and above ``<Location />`` add:
281+Go back to ``/etc/apache2/apache2.conf`` and above ``<Location />`` add:
276282
277283.. code:: apache
278284
@@ -282,24 +288,30 @@ Restart Apache:
282288
283289.. code:: sh
284290
285− sudo /etc/init.d/apache2 restart
291+ sudo -H /etc/init.d/apache2 restart
286292
287293How to update
288−-------------
294+=============
289295
290296.. code:: sh
291297
292298 cd /usr/local/searx
293− sudo -u searx -i
294− . ./searx-ve/bin/activate
295− git stash
296− git pull origin master
297− git stash apply
298− ./manage.sh update_packages
299− sudo service uwsgi restart
299+ sudo -H -u searx -i
300+
301+.. code:: sh
302+
303+ (searx)$ . ./searx-ve/bin/activate
304+ (searx)$ git stash
305+ (searx)$ git pull origin master
306+ (searx)$ git stash apply
307+ (searx)$ ./manage.sh update_packages
308+
309+.. code:: sh
310+
311+ sudo -H service uwsgi restart
300312
301313Docker
302−------
314+======
303315
304316Make sure you have installed Docker. For instance, you can deploy searx like this:
305317
@@ -308,22 +320,22 @@ Make sure you have installed Docker. For instance, you can deploy searx like thi
308320 docker pull wonderfall/searx
309321 docker run -d --name searx -p $PORT:8888 wonderfall/searx
310322
311−Go to http://localhost:$PORT.
312−
313−See https://hub.docker.com/r/wonderfall/searx/ for more informations.
323+Go to ``http://localhost:$PORT``.
314324
315−It's also possible to build searx from the embedded Dockerfile.
325+See https://hub.docker.com/r/wonderfall/searx/ for more informations. It's also
326+possible to build searx from the embedded Dockerfile.
316327
317328.. code:: sh
318329
319− git clone https://github.com/asciimoo/searx.git
320− cd searx
321− docker build -t whatever/searx .
330+ git clone https://github.com/asciimoo/searx.git
331+ cd searx
332+ docker build -t whatever/searx .
322333
323334References
324335==========
325336
326− * https://about.okhin.fr/posts/Searx/ with some additions
337+* https://about.okhin.fr/posts/Searx/ with some additions
327338
328− * How to: `Setup searx in a couple of hours with a free SSL certificate <https://www.reddit.com/r/privacytoolsIO/comments/366kvn/how_to_setup_your_own_privacy_respecting_search/>`__
339+* How to: `Setup searx in a couple of hours with a free SSL certificate
340+ <https://www.reddit.com/r/privacytoolsIO/comments/366kvn/how_to_setup_your_own_privacy_respecting_search/>`__
329341
_sources/admin/morty.rst.txtnew file+26
@@ -0,0 +1,26 @@
1+=========================
2+How to setup result proxy
3+=========================
4+
5+.. _morty: https://github.com/asciimoo/morty
6+.. _morty's README: https://github.com/asciimoo/morty
7+
8+By default searx can only act as an image proxy for result images, but it is
9+possible to proxify all the result URLs with an external service, morty_.
10+
11+To use this feature, morty has to be installed and activated in searx's
12+``settings.yml``.
13+
14+Add the following snippet to your ``settings.yml`` and restart searx:
15+
16+.. code:: yaml
17+
18+ result_proxy:
19+ url : http://127.0.0.1:3000/
20+ key : your_morty_proxy_key
21+
22+``url``
23+ Is the address of the running morty service.
24+
25+``key``
26+ Is an optional argument, see `morty's README`_ for more information.
_sources/admin/plugins.rst.txtnew file+39
@@ -0,0 +1,39 @@
1+.. _plugins generic:
2+
3+===============
4+Plugins builtin
5+===============
6+
7+.. sidebar:: Further reading ..
8+
9+ - :ref:`dev plugin`
10+
11+Configuration defaults (at built time):
12+
13+:DO: Default on
14+
15+.. _configured plugins:
16+
17+.. jinja:: webapp
18+
19+ .. flat-table:: Plugins configured at built time (defaults)
20+ :header-rows: 1
21+ :stub-columns: 1
22+ :widths: 3 1 9
23+
24+ * - Name
25+ - DO
26+ - Description
27+
28+ JS & CSS dependencies
29+
30+ {% for plgin in plugins %}
31+
32+ * - {{plgin.name}}
33+ - {{(plgin.default_on and "y") or ""}}
34+ - {{plgin.description}}
35+
36+ {% for dep in (plgin.js_dependencies + plgin.css_dependencies) %}
37+ | ``{{dep}}`` {% endfor %}
38+
39+ {% endfor %}
_sources/blog/admin.rst.txtnew file+43
@@ -0,0 +1,43 @@
1+=============================================================
2+Searx admin interface
3+=============================================================
4+
5+.. _searx-admin: https://github.com/kvch/searx-admin#searx-admin
6+.. _NLnet Foundation: https://nlnet.nl/
7+
8+ manage your instance from your browser
9+
10+.. sidebar:: Installation
11+
12+ Installation guide can be found in the repository of searx-admin_.
13+
14+One of the biggest advantages of searx is being extremely customizable. But at
15+first it can be daunting to newcomers. A barrier of taking advantage of this
16+feature is our ugly settings file which is sometimes hard to understand and
17+edit.
18+
19+To make self-hosting searx more accessible a new tool is introduced, called
20+``searx-admin``. It is a web application which is capable of managing your
21+instance and manipulating its settings via a web UI. It aims to replace editing
22+of ``settings.yml`` for less experienced administrators or people who prefer
23+graphical admin interfaces.
24+
25+.. figure:: searx-admin-engines.png
26+ :alt: Screenshot of engine list
27+
28+ Configuration page of engines
29+
30+Since ``searx-admin`` acts as a supervisor for searx, we have decided to
31+implement it as a standalone tool instead of part of searx. Another reason for
32+making it a standalone tool is that the codebase and dependencies of searx
33+should not grow because of a fully optional feature, which does not affect
34+existing instances.
35+
36+
37+Acknowledgements
38+================
39+
40+This development was sponsored by `NLnet Foundation`_.
41+
42+| Happy hacking.
43+| kvch // 2017.08.22 21:25
_sources/blog/blog.txtdeleted−7
@@ -1,7 +0,0 @@
1−Blog
2−====
3−
4−.. toctree::
5− :maxdepth: 1
6−
7− python3
docs/blog/blog.rst → _sources/blog/index.rst.txtrenamed+1
@@ -1,3 +1,4 @@
1+====
12Blog
23====
34
_sources/blog/intro-offline.rst.txtnew file+77
@@ -0,0 +1,77 @@
1+===============================
2+Preparation for offline engines
3+===============================
4+
5+Offline engines
6+===============
7+
8+To extend the functionality of searx, offline engines are going to be
9+introduced. An offline engine is an engine which does not need Internet
10+connection to perform a search and does not use HTTP to communicate.
11+
12+Offline engines can be configured as online engines, by adding those to the
13+`engines` list of :origin:`settings.yml <searx/settings.yml>`. Thus, searx
14+finds the engine file and imports it.
15+
16+Example skeleton for the new engines:
17+
18+.. code:: python
19+
20+ from subprocess import PIPE, Popen
21+
22+ categories = ['general']
23+ offline = True
24+
25+ def init(settings):
26+ pass
27+
28+ def search(query, params):
29+ process = Popen(['ls', query], stdout=PIPE)
30+ return_code = process.wait()
31+ if return_code != 0:
32+ raise RuntimeError('non-zero return code', return_code)
33+
34+ results = []
35+ line = process.stdout.readline()
36+ while line:
37+ result = parse_line(line)
38+ results.append(results)
39+
40+ line = process.stdout.readline()
41+
42+ return results
43+
44+
45+Development progress
46+====================
47+
48+First, a proposal has been created as a Github issue. Then it was moved to the
49+wiki as a design document. You can read it here: :wiki:`Offline-engines`.
50+
51+In this development step, searx core was prepared to accept and perform offline
52+searches. Offline search requests are scheduled together with regular offline
53+requests.
54+
55+As offline searches can return arbitrary results depending on the engine, the
56+current result templates were insufficient to present such results. Thus, a new
57+template is introduced which is caplable of presenting arbitrary key value pairs
58+as a table. You can check out the pull request for more details see
59+:pull:`1700`.
60+
61+Next steps
62+==========
63+
64+Today, it is possible to create/run an offline engine. However, it is going to be publicly available for everyone who knows the searx instance. So the next step is to introduce token based access for engines. This way administrators are able to limit the access to private engines.
65+
66+Acknowledgement
67+===============
68+
69+This development was sponsored by `Search and Discovery Fund`_ of `NLnet Foundation`_ .
70+
71+.. _Search and Discovery Fund: https://nlnet.nl/discovery
72+.. _NLnet Foundation: https://nlnet.nl/
73+
74+
75+| Happy hacking.
76+| kvch // 2019.10.21 17:03
77+
_sources/blog/python3.rst.txtnew file+68
@@ -0,0 +1,68 @@
1+============================
2+Introducing Python 3 support
3+============================
4+
5+.. _Python 2.7 clock: https://pythonclock.org/
6+
7+.. sidebar:: Python 2.7 to 3 upgrade
8+
9+ This chapter exists of historical reasons. Python 2.7 release schedule ends
10+ (`Python 2.7 clock`_) after 11 years Python 3 exists
11+
12+As most operation systems are coming with Python3 installed by default. So it is
13+time for searx to support Python3. But don't worry support of Python2.7 won't be
14+dropped.
15+
16+.. image:: searxpy3.png
17+ :scale: 50 %
18+ :alt: hurray
19+ :align: center
20+
21+
22+How to run searx using Python 3
23+===============================
24+
25+Please make sure that you run at least Python 3.5.
26+
27+To run searx, first a Python3 virtualenv should be created. After entering the
28+virtualenv, dependencies must be installed. Then run searx with python3 instead
29+of the usual python command.
30+
31+.. code:: sh
32+
33+ virtualenv -p python3 venv3
34+ source venv3/bin/activate
35+ pip3 install -r requirements.txt
36+ python3 searx/webapp.py
37+
38+
39+If you want to run searx using Python2.7, you don't have to do anything
40+differently as before.
41+
42+Fun facts
43+=========
44+
45+- 115 files were changed when implementing the support for both Python versions.
46+
47+- All of the dependencies was compatible except for the robotframework used for
48+ browser tests. Thus, these tests were migrated to splinter. So from now on
49+ both versions are being tested on Travis and can be tested locally.
50+
51+If you found bugs
52+=================
53+
54+Please open an issue on `GitHub`_. Make sure that you mention your Python
55+version in your issue, so we can investigate it properly.
56+
57+.. _GitHub: https://github.com/asciimoo/searx/issues
58+
59+Acknowledgment
60+==============
61+
62+This development was sponsored by `NLnet Foundation`_.
63+
64+.. _NLnet Foundation: https://nlnet.nl/
65+
66+
67+| Happy hacking.
68+| kvch // 2017.05.13 22:57
_sources/blog/python3.txtdeleted−54
@@ -1,54 +0,0 @@
1−Introducing Python3 support
2−===========================
3−
4−As most operation systems are coming with Python3 installed by default. So it is time for searx to support Python3. But don't worry support of Python2.7 won't be dropped.
5−
6−.. image:: searxpy3.png
7− :scale: 50 %
8− :alt: hurray
9− :align: center
10−
11−
12−How to run searx using Python3
13−------------------------------
14−
15−Please make sure that you run at least Python3.5.
16−
17−To run searx, first a Python3 virtualenv should be created. After entering the virtualenv,
18−dependencies must be installed. Then run searx with python3 instead of the usual python command.
19−
20−.. code:: sh
21−
22− virtualenv -p python3 venv3
23− source venv3/bin/activate
24− pip3 install -r requirements.txt
25− python3 searx/webapp.py
26−
27−
28−If you want to run searx using Python2.7, you don't have to do anything differently as before.
29−
30−Fun facts
31−---------
32−
33−- 115 files were changed when implementing the support for both Python versions.
34−
35−- All of the dependencies was compatible except for the robotframework used for browser tests. Thus, these tests were migrated to splinter. So from now on both versions are being tested on Travis and can be tested locally.
36−
37−If you found bugs...
38−--------------------
39−
40−...please open an issue on `GitHub`_. Make sure that you mention your Python version in your issue,
41−so we can investigate it properly.
42−
43−.. _GitHub: https://github.com/asciimoo/searx/issues
44−
45−Acknowledgement
46−---------------
47−
48−This development was sponsored by `NLnet Foundation`_.
49−
50−.. _NLnet Foundation: https://nlnet.nl/
51−
52−
53−| Happy hacking.
54−| kvch // 2017.05.13 22:57
_sources/dev/contribution_guide.rst.txtnew file+180
@@ -0,0 +1,180 @@
1+.. _how to contribute:
2+
3+=================
4+How to contribute
5+=================
6+
7+Prime directives: Privacy, Hackability
8+======================================
9+
10+Searx has two prime directives, **privacy-by-design and hackability** . The
11+hackability comes in three levels:
12+
13+- support of search engines
14+- plugins to alter search behaviour
15+- hacking searx itself
16+
17+Note the lack of "world domination" among the directives. Searx has no
18+intention of wide mass-adoption, rounded corners, etc. The prime directive
19+"privacy" deserves a separate chapter, as it's quite uncommon unfortunately.
20+
21+Privacy-by-design
22+-----------------
23+
24+Searx was born out of the need for a **privacy-respecting** search tool which
25+can be extended easily to maximize both, its search and its privacy protecting
26+capabilities.
27+
28+A few widely used features work differently or turned off by default or not
29+implemented at all **as a consequence of privacy-by-design**.
30+
31+If a feature reduces the privacy preserving aspects of searx, it should be
32+switched off by default or should not implemented at all. There are plenty of
33+search engines already providing such features. If a feature reduces the
34+protection of searx, users must be informed about the effect of choosing to
35+enable it. Features that protect privacy but differ from the expectations of
36+the user should also be explained.
37+
38+Also, if you think that something works weird with searx, it's might be because
39+of the tool you use is designed in a way to interfere with the privacy respect.
40+Submitting a bugreport to the vendor of the tool that misbehaves might be a good
41+feedback to reconsider the disrespect to its customers (e.g. ``GET`` vs ``POST``
42+requests in various browsers).
43+
44+Remember the other prime directive of searx is to be hackable, so if the above
45+privacy concerns do not fancy you, simply fork it.
46+
47+ *Happy hacking.*
48+
49+Code
50+====
51+
52+.. _PEP8: https://www.python.org/dev/peps/pep-0008/
53+.. _Conventional Commits: https://www.conventionalcommits.org/
54+.. _Git Commit Good Practice: https://wiki.openstack.org/wiki/GitCommitMessages
55+.. _Structural split of changes:
56+ https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes
57+.. _gitmoji: https://gitmoji.carloscuesta.me/
58+.. _Semantic PR: https://github.com/zeke/semantic-pull-requests
59+
60+.. sidebar:: Create good commits!
61+
62+ - `Structural split of changes`_
63+ - `Conventional Commits`_
64+ - `Git Commit Good Practice`_
65+ - some like to use: gitmoji_
66+ - not yet active: `Semantic PR`_
67+
68+In order to submit a patch, please follow the steps below:
69+
70+- Follow coding conventions.
71+
72+ - PEP8_ standards apply, except the convention of line length
73+ - Maximum line length is 120 characters
74+
75+- The cardinal rule for creating good commits is to ensure there is only one
76+ *logical change* per commit / read `Structural split of changes`_
77+
78+- Check if your code breaks existing tests. If so, update the tests or fix your
79+ code.
80+
81+- If your code can be unit-tested, add unit tests.
82+
83+- Add yourself to the :origin:`AUTHORS.rst` file.
84+
85+- Choose meaning full commit messages, read `Conventional Commits`_
86+
87+ .. code::
88+
89+ <type>[optional scope]: <description>
90+
91+ [optional body]
92+
93+ [optional footer(s)]
94+
95+- Create a pull request.
96+
97+For more help on getting started with searx development, see :ref:`devquickstart`.
98+
99+
100+Translation
101+===========
102+
103+Translation currently takes place on :ref:`transifex <translation>`.
104+
105+.. caution::
106+
107+ Please, do not update translation files in the repo.
108+
109+
110+.. _contrib docs:
111+
112+Documentation
113+=============
114+
115+.. _Sphinx: http://www.sphinx-doc.org
116+.. _reST: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
117+
118+.. sidebar:: The reST sources
119+
120+ has been moved from ``gh-branch`` into ``master`` (:origin:`docs`).
121+
122+The documentation is built using Sphinx_. So in order to be able to generate
123+the required files, you have to install it on your system. Much easier, use
124+our :ref:`makefile`.
125+
126+Here is an example which makes a complete rebuild:
127+
128+.. code:: sh
129+
130+ $ make docs-clean docs
131+ ...
132+ The HTML pages are in dist/docs.
133+
134+.. _make docs-live:
135+
136+live build
137+----------
138+
139+.. sidebar:: docs-clean
140+
141+ It is recommended to assert a complete rebuild before deploying (use
142+ ``docs-clean``).
143+
144+Live build is like WYSIWYG. If you want to edit the documentation, its
145+recommended to use. The Makefile target ``docs-live`` builds the docs, opens
146+URL in your favorite browser and rebuilds every time a reST file has been
147+changed.
148+
149+.. code:: sh
150+
151+ $ make docs-live
152+ ...
153+ The HTML pages are in dist/docs.
154+ ... Serving on http://0.0.0.0:8080
155+ ... Start watching changes
156+
157+
158+.. _deploy on github.io:
159+
160+deploy on github.io
161+-------------------
162+
163+To deploy documentation at :docs:`github.io <.>` use Makefile target
164+:ref:`make gh-pages`, which will builds the documentation, clones searx into a sub
165+folder ``gh-pages``, cleans it, copies the doc build into and runs all the
166+needed git add, commit and push:
167+
168+.. code:: sh
169+
170+ $ make docs-clean gh-pages
171+ ...
172+ SPHINX docs --> file://<...>/dist/docs
173+ The HTML pages are in dist/docs.
174+ ...
175+ Cloning into 'gh-pages' ...
176+ ...
177+ cd gh-pages; git checkout gh-pages >/dev/null
178+ Switched to a new branch 'gh-pages'
179+ ...
180+ doc available at --> https://asciimoo.github.io/searx
_sources/dev/contribution_guide.txtdeleted−98
@@ -1,98 +0,0 @@
1−How to contribute
2−-----------------
3−
4−Prime directives: Privacy, Hackability
5−~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6−
7−Searx has two prime directives, privacy-by-design and hackability. The
8−hackability comes in three levels:
9−
10−- support of search engines
11−- plugins to alter search behaviour
12−- hacking searx itself
13−
14−Note the lack of "world domination" among the directives.
15−Searx has no intention of wide mass-adoption, rounded
16−corners, etc. The prime directive "privacy" deserves a separate
17−chapter, as it's quite uncommon unfortunately.
18−
19−Privacy-by-design
20−^^^^^^^^^^^^^^^^^
21−
22−Searx was born out of the need for a privacy-respecting search tool
23−which can be extended easily to maximize both its search and its
24−privacy protecting capabilities.
25−
26−A few widely used features work differently or turned off by default or not implemented
27−at all as a consequence of privacy-by-design.
28−
29−If a feature reduces the privacy preserving aspects of searx, it
30−should be switched off by default or should not implemented at all.
31−There are plenty of search engines already providing such features.
32−If a feature reduces the protection of searx, users must be
33−informed about the effect of choosing to enable it. Features
34−that protect privacy but differ from the expectations of the
35−user should also be explained.
36−
37−Also, if you think that something works weird with searx,
38−it's might be because of the tool you use is designed in a way to interfere with
39−the privacy respect. Submitting a bugreport to the vendor of the tool that
40−misbehaves might be a good feedback to reconsider the disrespect to
41−its customers (e.g. GET vs POST requests in various browsers).
42−
43−Remember the other prime directive of searx is to be hackable, so if the
44−above privacy concerns do not fancy you, simply fork it.
45−
46−Happy hacking.
47−
48−Code
49−~~~~
50−
51−In order to submit a patch, please follow the steps below:
52−
53−- Follow coding conventions.
54−
55− - PEP8 standards apply, except the convention of line length
56−
57− - Maximum line length is 120 characters
58−
59−- Check if your code breaks existing tests. If so, update the tests or fix your code.
60−
61−- If your code can be unit-tested, add unit tests.
62−
63−- Add yourself to the AUTHORS file.
64−
65−- Create a pull request.
66−
67−For more help on getting started with searx development, see :ref:`devquickstart`.
68−
69−
70−Translation
71−~~~~~~~~~~~
72−
73−Translation currently takes place on
74−`transifex <https://transifex.com/projects/p/searx>`__.
75−
76−**Please, do not update translation files in the repo.**
77−
78−Documentation
79−~~~~~~~~~~~~~
80−
81−The documentation is built using Sphinx. So in order to be able to generate the required
82−files, you have to install it on your system. (It can be installed easily using pip.)
83−
84−1. Checkout the gh-pages branch.
85−
86−2. Edit the rst file you wish to update. Or create a new rst file and place it under the appropriate folder.
87−
88−3. Build the documentation using Sphinx.
89−
90−4. Add the updated and created files of these extension:
91−
92− - .rst
93−
94− - .html
95−
96− - .txt
97−
98−6. Create a pull request.
_sources/dev/engine_overview.rst.txtnew file+267
@@ -0,0 +1,267 @@
1+
2+.. _engines-dev:
3+
4+===============
5+Engine overview
6+===============
7+
8+.. _metasearch-engine: https://en.wikipedia.org/wiki/Metasearch_engine
9+
10+searx is a metasearch-engine_, so it uses different search engines to provide
11+better results.
12+
13+Because there is no general search API which could be used for every search
14+engine, an adapter has to be built between searx and the external search
15+engines. Adapters are stored under the folder :origin:`searx/engines`.
16+
17+.. contents::
18+ :depth: 3
19+ :backlinks: entry
20+
21+general engine configuration
22+============================
23+
24+It is required to tell searx the type of results the engine provides. The
25+arguments can be set in the engine file or in the settings file
26+(normally ``settings.yml``). The arguments in the settings file override
27+the ones in the engine file.
28+
29+It does not matter if an option is stored in the engine file or in the
30+settings. However, the standard way is the following:
31+
32+.. _engine file:
33+
34+engine file
35+-----------
36+
37+======================= =========== ===========================================
38+argument type information
39+======================= =========== ===========================================
40+categories list pages, in which the engine is working
41+paging boolean support multible pages
42+language_support boolean support language choosing
43+time_range_support boolean support search time range
44+offline boolean engine runs offline
45+======================= =========== ===========================================
46+
47+.. _engine settings:
48+
49+settings.yml
50+------------
51+
52+======================= =========== ===========================================
53+argument type information
54+======================= =========== ===========================================
55+name string name of search-engine
56+engine string name of searx-engine
57+ (filename without ``.py``)
58+shortcut string shortcut of search-engine
59+timeout string specific timeout for search-engine
60+======================= =========== ===========================================
61+
62+
63+overrides
64+---------
65+
66+A few of the options have default values in the engine, but are often
67+overwritten by the settings. If ``None`` is assigned to an option in the engine
68+file, it has to be redefined in the settings, otherwise searx will not start
69+with that engine.
70+
71+The naming of overrides is arbitrary. But the recommended overrides are the
72+following:
73+
74+======================= =========== ===========================================
75+argument type information
76+======================= =========== ===========================================
77+base_url string base-url, can be overwritten to use same
78+ engine on other URL
79+number_of_results int maximum number of results per request
80+language string ISO code of language and country like en_US
81+api_key string api-key if required by engine
82+======================= =========== ===========================================
83+
84+example code
85+------------
86+
87+.. code:: python
88+
89+ # engine dependent config
90+ categories = ['general']
91+ paging = True
92+ language_support = True
93+
94+
95+making a request
96+================
97+
98+To perform a search an URL have to be specified. In addition to specifying an
99+URL, arguments can be passed to the query.
100+
101+passed arguments
102+----------------
103+
104+These arguments can be used to construct the search query. Furthermore,
105+parameters with default value can be redefined for special purposes.
106+
107+====================== ============ ========================================================================
108+argument type default-value, information
109+====================== ============ ========================================================================
110+url string ``''``
111+method string ``'GET'``
112+headers set ``{}``
113+data set ``{}``
114+cookies set ``{}``
115+verify boolean ``True``
116+headers.User-Agent string a random User-Agent
117+category string current category, like ``'general'``
118+started datetime current date-time
119+pageno int current pagenumber
120+language string specific language code like ``'en_US'``, or ``'all'`` if unspecified
121+====================== ============ ========================================================================
122+
123+parsed arguments
124+----------------
125+
126+The function ``def request(query, params):`` always returns the ``params``
127+variable. Inside searx, the following paramters can be used to specify a search
128+request:
129+
130+============ =========== =========================================================
131+argument type information
132+============ =========== =========================================================
133+url string requested url
134+method string HTTP request method
135+headers set HTTP header information
136+data set HTTP data information (parsed if ``method != 'GET'``)
137+cookies set HTTP cookies
138+verify boolean Performing SSL-Validity check
139+============ =========== =========================================================
140+
141+
142+example code
143+------------
144+
145+.. code:: python
146+
147+ # search-url
148+ base_url = 'https://example.com/'
149+ search_string = 'search?{query}&page={page}'
150+
151+ # do search-request
152+ def request(query, params):
153+ search_path = search_string.format(
154+ query=urlencode({'q': query}),
155+ page=params['pageno'])
156+
157+ params['url'] = base_url + search_path
158+
159+ return params
160+
161+
162+returned results
163+================
164+
165+Searx is able to return results of different media-types. Currently the
166+following media-types are supported:
167+
168+- default_
169+- images_
170+- videos_
171+- torrent_
172+- map_
173+
174+To set another media-type as default, the parameter ``template`` must be set to
175+the desired type.
176+
177+default
178+-------
179+
180+========================= =====================================================
181+result-parameter information
182+========================= =====================================================
183+url string, url of the result
184+title string, title of the result
185+content string, general result-text
186+publishedDate :py:class:`datetime.datetime`, time of publish
187+========================= =====================================================
188+
189+images
190+------
191+
192+To use this template, the parameter:
193+
194+========================= =====================================================
195+result-parameter information
196+========================= =====================================================
197+template is set to ``images.html``
198+url string, url to the result site
199+title string, title of the result *(partly implemented)*
200+content *(partly implemented)*
201+publishedDate :py:class:`datetime.datetime`,
202+ time of publish *(partly implemented)*
203+img\_src string, url to the result image
204+thumbnail\_src string, url to a small-preview image
205+========================= =====================================================
206+
207+videos
208+------
209+
210+========================= =====================================================
211+result-parameter information
212+========================= =====================================================
213+template is set to ``videos.html``
214+url string, url of the result
215+title string, title of the result
216+content *(not implemented yet)*
217+publishedDate :py:class:`datetime.datetime`, time of publish
218+thumbnail string, url to a small-preview image
219+========================= =====================================================
220+
221+torrent
222+-------
223+
224+.. _magnetlink: https://en.wikipedia.org/wiki/Magnet_URI_scheme
225+
226+========================= =====================================================
227+result-parameter information
228+========================= =====================================================
229+template is set to ``torrent.html``
230+url string, url of the result
231+title string, title of the result
232+content string, general result-text
233+publishedDate :py:class:`datetime.datetime`,
234+ time of publish *(not implemented yet)*
235+seed int, number of seeder
236+leech int, number of leecher
237+filesize int, size of file in bytes
238+files int, number of files
239+magnetlink string, magnetlink_ of the result
240+torrentfile string, torrentfile of the result
241+========================= =====================================================
242+
243+
244+map
245+---
246+
247+========================= =====================================================
248+result-parameter information
249+========================= =====================================================
250+url string, url of the result
251+title string, title of the result
252+content string, general result-text
253+publishedDate :py:class:`datetime.datetime`, time of publish
254+latitude latitude of result (in decimal format)
255+longitude longitude of result (in decimal format)
256+boundingbox boundingbox of result (array of 4. values
257+ ``[lat-min, lat-max, lon-min, lon-max]``)
258+geojson geojson of result (http://geojson.org)
259+osm.type type of osm-object (if OSM-Result)
260+osm.id id of osm-object (if OSM-Result)
261+address.name name of object
262+address.road street name of object
263+address.house_number house number of object
264+address.locality city, place of object
265+address.postcode postcode of object
266+address.country country of object
267+========================= =====================================================
_sources/dev/engine_overview.txtdeleted−313
@@ -1,313 +0,0 @@
1−Engine overview
2−===============
3−
4−
5−searx is a `metasearch-engine <https://en.wikipedia.org/wiki/Metasearch_engine>`__,
6−so it uses different search engines to provide better results.
7−
8−Because there is no general search API which could be used for every
9−search engine, an adapter has to be built between searx and the
10−external search engines. Adapters are stored under the folder
11−`searx/engines
12−<https://github.com/asciimoo/searx/tree/master/searx/engines>`__.
13−
14−
15−.. contents::
16− :depth: 3
17−
18−general engine configuration
19−----------------------------
20−
21−It is required to tell searx the type of results the engine provides. The
22−arguments can be set in the engine file or in the settings file
23−(normally ``settings.yml``). The arguments in the settings file override
24−the ones in the engine file.
25−
26−It does not matter if an option is stored in the engine file or in the
27−settings. However, the standard way is the following:
28−
29−
30−engine file
31−~~~~~~~~~~~
32−
33−+----------------------+-----------+-----------------------------------------+
34−| argument | type | information |
35−+======================+===========+=========================================+
36−| categories | list | pages, in which the engine is working |
37−+----------------------+-----------+-----------------------------------------+
38−| paging | boolean | support multible pages |
39−+----------------------+-----------+-----------------------------------------+
40−| language\_support | boolean | support language choosing |
41−+----------------------+-----------+-----------------------------------------+
42−| time\_range\_support | boolean | support search time range |
43−+----------------------+-----------+-----------------------------------------+
44−
45−settings.yml
46−~~~~~~~~~~~~
47−
48−+------------+----------+-----------------------------------------------+
49−| argument | type | information |
50−+============+==========+===============================================+
51−| name | string | name of search-engine |
52−+------------+----------+-----------------------------------------------+
53−| engine | string | name of searx-engine (filename without .py) |
54−+------------+----------+-----------------------------------------------+
55−| shortcut | string | shortcut of search-engine |
56−+------------+----------+-----------------------------------------------+
57−| timeout | string | specific timeout for search-engine |
58−+------------+----------+-----------------------------------------------+
59−
60−overrides
61−~~~~~~~~~
62−
63−A few of the options have default values in the engine, but are
64−often overwritten by the settings. If ``None`` is assigned to an option
65−in the engine file, it has to be redefined in the settings,
66−otherwise searx will not start with that engine.
67−
68−The naming of overrides is arbitrary. But the recommended
69−overrides are the following:
70−
71−+-----------------------+----------+----------------------------------------------------------------+
72−| argument | type | information |
73−+=======================+==========+================================================================+
74−| base\_url | string | base-url, can be overwritten to use same engine on other URL |
75−+-----------------------+----------+----------------------------------------------------------------+
76−| number\_of\_results | int | maximum number of results per request |
77−+-----------------------+----------+----------------------------------------------------------------+
78−| language | string | ISO code of language and country like en\_US |
79−+-----------------------+----------+----------------------------------------------------------------+
80−| api\_key | string | api-key if required by engine |
81−+-----------------------+----------+----------------------------------------------------------------+
82−
83−example code
84−~~~~~~~~~~~~
85−
86−.. code:: python
87−
88− # engine dependent config
89− categories = ['general']
90− paging = True
91− language_support = True
92−
93−making a request
94−----------------
95−
96−To perform a search an URL have to be specified. In addition to
97−specifying an URL, arguments can be passed to the query.
98−
99−passed arguments
100−~~~~~~~~~~~~~~~~
101−
102−These arguments can be used to construct the search query. Furthermore,
103−parameters with default value can be redefined for special purposes.
104−
105−+----------------------+------------+------------------------------------------------------------------------+
106−| argument | type | default-value, information |
107−+======================+============+========================================================================+
108−| url | string | ``''`` |
109−+----------------------+------------+------------------------------------------------------------------------+
110−| method | string | ``'GET'`` |
111−+----------------------+------------+------------------------------------------------------------------------+
112−| headers | set | ``{}`` |
113−+----------------------+------------+------------------------------------------------------------------------+
114−| data | set | ``{}`` |
115−+----------------------+------------+------------------------------------------------------------------------+
116−| cookies | set | ``{}`` |
117−+----------------------+------------+------------------------------------------------------------------------+
118−| verify | boolean | ``True`` |
119−+----------------------+------------+------------------------------------------------------------------------+
120−| headers.User-Agent | string | a random User-Agent |
121−+----------------------+------------+------------------------------------------------------------------------+
122−| category | string | current category, like ``'general'`` |
123−+----------------------+------------+------------------------------------------------------------------------+
124−| started | datetime | current date-time |
125−+----------------------+------------+------------------------------------------------------------------------+
126−| pageno | int | current pagenumber |
127−+----------------------+------------+------------------------------------------------------------------------+
128−| language | string | specific language code like ``'en_US'``, or ``'all'`` if unspecified |
129−+----------------------+------------+------------------------------------------------------------------------+
130−
131−parsed arguments
132−~~~~~~~~~~~~~~~~
133−
134−The function ``def request(query, params):`` always returns the
135−``params`` variable. Inside searx, the following paramters can be
136−used to specify a search request:
137−
138−+------------+-----------+---------------------------------------------------------+
139−| argument | type | information |
140−+============+===========+=========================================================+
141−| url | string | requested url |
142−+------------+-----------+---------------------------------------------------------+
143−| method | string | HTTP request method |
144−+------------+-----------+---------------------------------------------------------+
145−| headers | set | HTTP header information |
146−+------------+-----------+---------------------------------------------------------+
147−| data | set | HTTP data information (parsed if ``method != 'GET'``) |
148−+------------+-----------+---------------------------------------------------------+
149−| cookies | set | HTTP cookies |
150−+------------+-----------+---------------------------------------------------------+
151−| verify | boolean | Performing SSL-Validity check |
152−+------------+-----------+---------------------------------------------------------+
153−
154−example code
155−~~~~~~~~~~~~
156−
157−.. code:: python
158−
159− # search-url
160− base_url = 'https://example.com/'
161− search_string = 'search?{query}&page={page}'
162−
163− # do search-request
164− def request(query, params):
165− search_path = search_string.format(
166− query=urlencode({'q': query}),
167− page=params['pageno'])
168−
169− params['url'] = base_url + search_path
170−
171− return params
172−
173−returned results
174−----------------
175−
176−Searx is able to return results of different media-types.
177−Currently the following media-types are supported:
178−
179−- default
180−- images
181−- videos
182−- torrent
183−- map
184−
185−To set another media-type as default, the parameter
186−``template`` must be set to the desired type.
187−
188−default
189−~~~~~~~
190−
191−+--------------------+---------------------------------------------------------------------------------------------------------------+
192−| result-parameter | information |
193−+====================+===============================================================================================================+
194−| url | string, url of the result |
195−+--------------------+---------------------------------------------------------------------------------------------------------------+
196−| title | string, title of the result |
197−+--------------------+---------------------------------------------------------------------------------------------------------------+
198−| content | string, general result-text |
199−+--------------------+---------------------------------------------------------------------------------------------------------------+
200−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish |
201−+--------------------+---------------------------------------------------------------------------------------------------------------+
202−
203−images
204−~~~~~~
205−
206−to use this template, the parameter
207−
208−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
209−| result-parameter | information |
210−+====================+=======================================================================================================================================+
211−| template | is set to ``images.html`` |
212−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
213−| url | string, url to the result site |
214−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
215−| title | string, title of the result *(partly implemented)* |
216−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
217−| content | *(partly implemented)* |
218−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
219−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish *(partly implemented)* |
220−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
221−| img\_src | string, url to the result image |
222−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
223−| thumbnail\_src | string, url to a small-preview image |
224−+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
225−
226−videos
227−~~~~~~
228−
229−+--------------------+--------------------------------------------------------------------------------------------------------------+
230−| result-parameter | information |
231−+====================+==============================================================================================================+
232−| template | is set to ``videos.html`` |
233−+--------------------+--------------------------------------------------------------------------------------------------------------+
234−| url | string, url of the result |
235−+--------------------+--------------------------------------------------------------------------------------------------------------+
236−| title | string, title of the result |
237−+--------------------+--------------------------------------------------------------------------------------------------------------+
238−| content | *(not implemented yet)* |
239−+--------------------+--------------------------------------------------------------------------------------------------------------+
240−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish |
241−+--------------------+--------------------------------------------------------------------------------------------------------------+
242−| thumbnail | string, url to a small-preview image |
243−+--------------------+--------------------------------------------------------------------------------------------------------------+
244−
245−torrent
246−~~~~~~~
247−
248−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
249−| result-parameter | information |
250−+==================+=======================================================================================================================================+
251−| template | is set to ``torrent.html`` |
252−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
253−| url | string, url of the result |
254−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
255−| title | string, title of the result |
256−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
257−| content | string, general result-text |
258−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
259−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish *(not implemented yet)* |
260−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
261−| seed | int, number of seeder |
262−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
263−| leech | int, number of leecher |
264−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
265−| filesize | int, size of file in bytes |
266−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
267−| files | int, number of files |
268−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
269−| magnetlink | string, `magnetlink <https://en.wikipedia.org/wiki/Magnet_URI_scheme>`__ of the result |
270−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
271−| torrentfile | string, torrentfile of the result |
272−+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
273−
274−
275−map
276−~~~
277−
278−+-------------------------+--------------------------------------------------------------------------------------------------------------+
279−| result-parameter | information |
280−+=========================+==============================================================================================================+
281−| url | string, url of the result |
282−+-------------------------+--------------------------------------------------------------------------------------------------------------+
283−| title | string, title of the result |
284−+-------------------------+--------------------------------------------------------------------------------------------------------------+
285−| content | string, general result-text |
286−+-------------------------+--------------------------------------------------------------------------------------------------------------+
287−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish |
288−+-------------------------+--------------------------------------------------------------------------------------------------------------+
289−| latitude | latitude of result (in decimal format) |
290−+-------------------------+--------------------------------------------------------------------------------------------------------------+
291−| longitude | longitude of result (in decimal format) |
292−+-------------------------+--------------------------------------------------------------------------------------------------------------+
293−| boundingbox | boundingbox of result (array of 4. values ``[lat-min, lat-max, lon-min, lon-max]``) |
294−+-------------------------+--------------------------------------------------------------------------------------------------------------+
295−| geojson | geojson of result (http://geojson.org) |
296−+-------------------------+--------------------------------------------------------------------------------------------------------------+
297−| osm.type | type of osm-object (if OSM-Result) |
298−+-------------------------+--------------------------------------------------------------------------------------------------------------+
299−| osm.id | id of osm-object (if OSM-Result) |
300−+-------------------------+--------------------------------------------------------------------------------------------------------------+
301−| address.name | name of object |
302−+-------------------------+--------------------------------------------------------------------------------------------------------------+
303−| address.road | street name of object |
304−+-------------------------+--------------------------------------------------------------------------------------------------------------+
305−| address.house\_number | house number of object |
306−+-------------------------+--------------------------------------------------------------------------------------------------------------+
307−| address.locality | city, place of object |
308−+-------------------------+--------------------------------------------------------------------------------------------------------------+
309−| address.postcode | postcode of object |
310−+-------------------------+--------------------------------------------------------------------------------------------------------------+
311−| address.country | country of object |
312−+-------------------------+--------------------------------------------------------------------------------------------------------------+
313−
_sources/dev/index.rst.txtnew file+15
@@ -0,0 +1,15 @@
1+=======================
2+Developer documentation
3+=======================
4+
5+.. toctree::
6+ :maxdepth: 1
7+
8+ quickstart
9+ contribution_guide
10+ engine_overview
11+ search_api
12+ plugins
13+ translation
14+ makefile
15+ reST
_sources/dev/install/installation.txtdeleted−323
@@ -1,323 +0,0 @@
1−.. _installation:
2−
3−Installation
4−============
5−
6−.. contents::
7− :depth: 3
8−
9−Basic installation
10−------------------
11−
12−Step by step installation for Debian/Ubuntu with virtualenv. For Ubuntu, be sure to have enable universe repository.
13−
14−Install packages:
15−
16−.. code:: sh
17−
18− sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev libffi-dev libssl-dev
19−
20−Install searx:
21−
22−.. code:: sh
23−
24− cd /usr/local
25− sudo git clone https://github.com/asciimoo/searx.git
26− sudo useradd searx -d /usr/local/searx
27− sudo chown searx:searx -R /usr/local/searx
28−
29−Install dependencies in a virtualenv:
30−
31−.. code:: sh
32−
33− sudo -u searx -i
34− cd /usr/local/searx
35− virtualenv searx-ve
36− . ./searx-ve/bin/activate
37− ./manage.sh update_packages
38−
39−Configuration
40−-------------
41−
42−.. code:: sh
43−
44− sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml
45−
46−Edit searx/settings.yml if necessary.
47−
48−Check
49−-----
50−
51−Start searx:
52−
53−.. code:: sh
54−
55− python searx/webapp.py
56−
57−Go to http://localhost:8888
58−
59−If everything works fine, disable the debug option in settings.yml:
60−
61−.. code:: sh
62−
63− sed -i -e "s/debug : True/debug : False/g" searx/settings.yml
64−
65−At this point searx is not demonized ; uwsgi allows this.
66−
67−You can exit the virtualenv and the searx user bash (enter exit command
68−twice).
69−
70−uwsgi
71−-----
72−
73−Install packages:
74−
75−.. code:: sh
76−
77− sudo apt-get install uwsgi uwsgi-plugin-python
78−
79−Create the configuration file /etc/uwsgi/apps-available/searx.ini with
80−this content:
81−
82−::
83−
84− [uwsgi]
85− # Who will run the code
86− uid = searx
87− gid = searx
88−
89− # disable logging for privacy
90− disable-logging = true
91−
92− # Number of workers (usually CPU count)
93− workers = 4
94−
95− # The right granted on the created socket
96− chmod-socket = 666
97−
98− # Plugin to use and interpretor config
99− single-interpreter = true
100− master = true
101− plugin = python
102− lazy-apps = true
103− enable-threads = true
104−
105− # Module to import
106− module = searx.webapp
107−
108− # Virtualenv and python path
109− virtualenv = /usr/local/searx/searx-ve/
110− pythonpath = /usr/local/searx/
111− chdir = /usr/local/searx/searx/
112−
113−Activate the uwsgi application and restart:
114−
115−.. code:: sh
116−
117− cd /etc/uwsgi/apps-enabled
118− ln -s ../apps-available/searx.ini
119− /etc/init.d/uwsgi restart
120−
121−Web server
122−----------
123−
124−with nginx
125−^^^^^^^^^^
126−
127−If nginx is not installed (uwsgi will not work with the package
128−nginx-light):
129−
130−.. code:: sh
131−
132− sudo apt-get install nginx
133−
134−Hosted at /
135−"""""""""""
136−
137−Create the configuration file /etc/nginx/sites-available/searx with this
138−content:
139−
140−.. code:: nginx
141−
142− server {
143− listen 80;
144− server_name searx.example.com;
145− root /usr/local/searx;
146−
147− location / {
148− include uwsgi_params;
149− uwsgi_pass unix:/run/uwsgi/app/searx/socket;
150− }
151− }
152−
153−Restart service:
154−
155−.. code:: sh
156−
157− sudo service nginx restart
158− sudo service uwsgi restart
159−
160−from subdirectory URL (/searx)
161−""""""""""""""""""""""""""""""
162−
163−Add this configuration in the server config file
164−/etc/nginx/sites-enabled/default:
165−
166−.. code:: nginx
167−
168− location = /searx { rewrite ^ /searx/; }
169− location /searx {
170− try_files $uri @searx;
171− }
172− location @searx {
173− uwsgi_param SCRIPT_NAME /searx;
174− include uwsgi_params;
175− uwsgi_modifier1 30;
176− uwsgi_pass unix:/run/uwsgi/app/searx/socket;
177− }
178−
179−
180−OR
181−
182−using reverse proxy
183−(Please, note that reverse proxy advised to be used in case of single-user or low-traffic instances.)
184−
185−.. code:: nginx
186−
187− location /searx {
188− proxy_pass http://127.0.0.1:8888;
189− proxy_set_header Host $host;
190− proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
191− proxy_set_header X-Scheme $scheme;
192− proxy_set_header X-Script-Name /searx;
193− proxy_buffering off;
194− }
195−
196−
197−Enable base\_url in searx/settings.yml
198−
199−::
200−
201− base_url : http://your.domain.tld/searx/
202−
203−Restart service:
204−
205−.. code:: sh
206−
207− sudo service nginx restart
208− sudo service uwsgi restart
209−
210−disable logs
211−~~~~~~~~~~~~
212−
213−for better privacy you can disable nginx logs about searx.
214−
215−how to proceed: below ``uwsgi_pass`` in
216−/etc/nginx/sites-available/default add
217−
218−::
219−
220− access_log /dev/null;
221− error_log /dev/null;
222−
223−Restart service:
224−
225−.. code:: sh
226−
227− sudo service nginx restart
228−
229−with apache
230−^^^^^^^^^^^
231−
232−Add wsgi mod:
233−
234−.. code:: sh
235−
236− sudo apt-get install libapache2-mod-uwsgi
237− sudo a2enmod uwsgi
238−
239−Add this configuration in the file /etc/apache2/apache2.conf:
240−
241−.. code:: apache
242−
243− <Location />
244− Options FollowSymLinks Indexes
245− SetHandler uwsgi-handler
246− uWSGISocket /run/uwsgi/app/searx/socket
247− </Location>
248−
249−Note that if your instance of searx is not at the root, you should
250−change ``<Location />`` by the location of your instance, like
251−``<Location /searx>``.
252−
253−Restart Apache:
254−
255−.. code:: sh
256−
257− sudo /etc/init.d/apache2 restart
258−
259−disable logs
260−""""""""""""
261−
262−For better privacy you can disable Apache logs.
263−
264−WARNING: not tested
265−
266−WARNING: you can only disable logs for the whole (virtual) server not
267−for a specific path.
268−
269−Go back to /etc/apache2/apache2.conf and above ``<Location />`` add:
270−
271−.. code:: apache
272−
273− CustomLog /dev/null combined
274−
275−Restart Apache:
276−
277−.. code:: sh
278−
279− sudo /etc/init.d/apache2 restart
280−
281−How to update
282−-------------
283−
284−.. code:: sh
285−
286− cd /usr/local/searx
287− sudo -u searx -i
288− . ./searx-ve/bin/activate
289− git stash
290− git pull origin master
291− git stash apply
292− ./manage.sh update_packages
293− sudo service uwsgi restart
294−
295−Docker
296−------
297−
298−Make sure you have installed Docker. For instance, you can deploy searx like this:
299−
300−.. code:: sh
301−
302− docker pull wonderfall/searx
303− docker run -d --name searx -p $PORT:8888 wonderfall/searx
304−
305−Go to http://localhost:$PORT.
306−
307−See https://hub.docker.com/r/wonderfall/searx/ for more informations.
308−
309−It's also possible to build searx from the embedded Dockerfile.
310−
311−.. code:: sh
312−
313− git clone https://github.com/asciimoo/searx.git
314− cd searx
315− docker build -t whatever/searx .
316−
317−References
318−==========
319−
320− * https://about.okhin.fr/posts/Searx/ with some additions
321−
322− * How to: `Setup searx in a couple of hours with a free SSL certificate <https://www.reddit.com/r/privacytoolsIO/comments/366kvn/how_to_setup_your_own_privacy_respecting_search/>`__
323−
_sources/dev/makefile.rst.txtnew file+221
@@ -0,0 +1,221 @@
1+.. _makefile:
2+
3+================
4+Makefile Targets
5+================
6+
7+.. _gnu-make: https://www.gnu.org/software/make/manual/make.html#Introduction
8+
9+.. sidebar:: build environment
10+
11+ Before looking deeper at the targets, first read about :ref:`makefile setup`
12+ and :ref:`make pyenv`.
13+
14+With the aim to simplify development cycles, started with :pull:`1756` a
15+``Makefile`` based boilerplate was added. If you are not familiar with
16+Makefiles, we recommend to read gnu-make_ introduction.
17+
18+The usage is simple, just type ``make {target-name}`` to *build* a target.
19+Calling the ``help`` target gives a first overview::
20+
21+ $ make help
22+ test - run developer tests
23+ docs - build documentation
24+ docs-live - autobuild HTML documentation while editing
25+ run - run developer instance
26+ install - developer install (./local)
27+ uninstall - uninstall (./local)
28+ gh-pages - build docs & deploy on gh-pages branch
29+ clean - drop builds and environments
30+ ...
31+
32+.. contents:: Contents
33+ :depth: 2
34+ :local:
35+ :backlinks: entry
36+
37+
38+.. _makefile setup:
39+
40+Setup
41+=====
42+
43+.. _git stash: https://git-scm.com/docs/git-stash
44+
45+The main setup is done in the :origin:`Makefile`::
46+
47+ export GIT_URL=https://github.com/asciimoo/searx
48+ export SEARX_URL=https://searx.me
49+ export DOCS_URL=https://asciimoo.github.io/searx
50+
51+.. sidebar:: fork & upstream
52+
53+ Commit changes in your (local) branch, fork or whatever, but do not push them
54+ upstream / `git stash`_ is your friend.
55+
56+:GIT_URL: Changes this, to point to your searx fork.
57+
58+:SEARX_URL: Changes this, to point to your searx instance.
59+
60+:DOCS_URL: If you host your own (branded) documentation, change this URL.
61+
62+.. _make pyenv:
63+
64+Python environment
65+==================
66+
67+.. sidebar:: activate environment
68+
69+ ``source ./local/py3/bin/activate``
70+
71+With Makefile we do no longer need to build up the virualenv manually (as
72+described in the :ref:`devquickstart` guide). Jump into your git working tree
73+and release a ``make pyenv``:
74+
75+.. code:: sh
76+
77+ $ cd ~/searx-clone
78+ $ make pyenv
79+ PYENV usage: source ./local/py3/bin/activate
80+ ...
81+
82+With target ``pyenv`` a development environment (aka virtualenv) was build up in
83+``./local/py3/``. To make a *developer install* of searx (:origin:`setup.py`)
84+into this environment, use make target ``install``:
85+
86+.. code:: sh
87+
88+ $ make install
89+ PYENV usage: source ./local/py3/bin/activate
90+ PYENV using virtualenv from ./local/py3
91+ PYENV install .
92+
93+You have never to think about intermediate targets like ``pyenv`` or
94+``install``, the ``Makefile`` chains them as requisites. Just run your main
95+target.
96+
97+.. sidebar:: drop environment
98+
99+ To get rid of the existing environment before re-build use :ref:`clean target
100+ <make clean>` first.
101+
102+If you think, something goes wrong with your ./local environment or you change
103+the :origin:`setup.py` file (or the requirements listed in
104+:origin:`requirements-dev.txt` and :origin:`requirements.txt`), you have to call
105+:ref:`make clean`.
106+
107+
108+.. _make run:
109+
110+``make run``
111+============
112+
113+To get up a running a developer instance simply call ``make run``. This enables
114+*debug* option in :origin:`searx/settings.yml`, starts a ``./searx/webapp.py``
115+instance, disables *debug* option again and opens the URL in your favorite WEB
116+browser (:man:`xdg-open`):
117+
118+.. code:: sh
119+
120+ $ make run
121+ PYENV usage: source ./local/py3/bin/activate
122+ PYENV install .
123+ ./local/py3/bin/python ./searx/webapp.py
124+ ...
125+ INFO:werkzeug: * Running on http://127.0.0.1:8888/ (Press CTRL+C to quit)
126+ ...
127+
128+.. _make clean:
129+
130+``make clean``
131+==============
132+
133+Drop all intermediate files, all builds, but keep sources untouched. Includes
134+target ``pyclean`` which drops ./local environment. Before calling ``make
135+clean`` stop all processes using :ref:`make pyenv`.
136+
137+.. code:: sh
138+
139+ $ make clean
140+ CLEAN pyclean
141+ CLEAN clean
142+
143+.. _make docs:
144+
145+``make docs docs-live docs-clean``
146+==================================
147+
148+We describe the usage of the ``doc*`` targets in the :ref:`How to contribute /
149+Documentation <contrib docs>` section. If you want to edit the documentation
150+read our :ref:`make docs-live` section. If you are working in your own brand,
151+adjust your :ref:`Makefile setup <makefile setup>`.
152+
153+
154+.. _make gh-pages:
155+
156+``make gh-pages``
157+=================
158+
159+To deploy on github.io first adjust your :ref:`Makefile setup <makefile
160+setup>`. For any further read :ref:`deploy on github.io`.
161+
162+.. _make test:
163+
164+``make test``
165+=============
166+
167+Runs a series of tests: ``test.pep8``, ``test.unit``, ``test.robot`` and does
168+additional :ref:`pylint checks <make pylint>`. You can run tests selective,
169+e.g.:
170+
171+.. code:: sh
172+
173+ $ make test.pep8 test.unit
174+ . ./local/py3/bin/activate; ./manage.sh pep8_check
175+ [!] Running pep8 check
176+ . ./local/py3/bin/activate; ./manage.sh unit_tests
177+ [!] Running unit tests
178+
179+.. _make pylint:
180+
181+``make pylint``
182+===============
183+
184+.. _Pylint: https://www.pylint.org/
185+
186+Before commiting its recommend to do some (more) linting. Pylint_ is known as
187+one of the best source-code, bug and quality checker for the Python programming
188+language. Pylint_ is not yet a quality gate within our searx project (like
189+:ref:`test.pep8 <make test>` it is), but Pylint_ can help to improve code
190+quality anyway. The pylint profile we use at searx project is found in
191+project's root folder :origin:`.pylintrc`.
192+
193+Code quality is a ongoing process. Don't try to fix all messages from Pylint,
194+run Pylint and check if your changed lines are bringing up new messages. If so,
195+fix it. By this, code quality gets incremental better and if there comes the
196+day, the linting is balanced out, we might decide to add Pylint as a quality
197+gate.
198+
199+
200+``make pybuild``
201+================
202+
203+.. _PyPi: https://pypi.org/
204+.. _twine: https://twine.readthedocs.io/en/latest/
205+
206+Build Python packages in ``./dist/py``.
207+
208+.. code:: sh
209+
210+ $ make pybuild
211+ ...
212+ BUILD pybuild
213+ running sdist
214+ running egg_info
215+ ...
216+ $ ls ./dist/py/
217+ searx-0.15.0-py3-none-any.whl searx-0.15.0.tar.gz
218+
219+To upload packages to PyPi_, there is also a ``upload-pypi`` target. It needs
220+twine_ to be installed. Since you are not the owner of :pypi:`searx` you will
221+never need the latter.
_sources/dev/plugins.rst.txtnew file+54
@@ -0,0 +1,54 @@
1+.. _dev plugin:
2+
3+=======
4+Plugins
5+=======
6+
7+.. sidebar:: Further reading ..
8+
9+ - :ref:`plugins generic`
10+
11+Plugins can extend or replace functionality of various components of searx.
12+
13+Example plugin
14+==============
15+
16+.. code:: python
17+
18+ name = 'Example plugin'
19+ description = 'This plugin extends the suggestions with the word "example"'
20+ default_on = False # disabled by default
21+
22+ js_dependencies = tuple() # optional, list of static js files
23+ css_dependencies = tuple() # optional, list of static css files
24+
25+
26+ # attach callback to the post search hook
27+ # request: flask request object
28+ # ctx: the whole local context of the post search hook
29+ def post_search(request, ctx):
30+ ctx['search'].suggestions.add('example')
31+ return True
32+
33+Plugin entry points
34+===================
35+
36+Entry points (hooks) define when a plugin runs. Right now only three hooks are
37+implemented. So feel free to implement a hook if it fits the behaviour of your
38+plugin.
39+
40+Pre search hook
41+---------------
42+
43+Runs BEFORE the search request. Function to implement: ``pre_search``
44+
45+Post search hook
46+----------------
47+
48+Runs AFTER the search request. Function to implement: ``post_search``
49+
50+Result hook
51+-----------
52+
53+Runs when a new result is added to the result list. Function to implement:
54+``on_result``
_sources/dev/plugins.txtdeleted−45
@@ -1,45 +0,0 @@
1−Plugins
2−-------
3−
4−Plugins can extend or replace functionality of various components of
5−searx.
6−
7−Example plugin
8−~~~~~~~~~~~~~~
9−
10−.. code:: python
11−
12− name = 'Example plugin'
13− description = 'This plugin extends the suggestions with the word "example"'
14− default_on = False # disabled by default
15−
16− js_dependencies = tuple() # optional, list of static js files
17− css_dependencies = tuple() # optional, list of static css files
18−
19−
20− # attach callback to the post search hook
21− # request: flask request object
22− # ctx: the whole local context of the post search hook
23− def post_search(request, ctx):
24− ctx['search'].suggestions.add('example')
25− return True
26−
27−Plugin entry points
28−~~~~~~~~~~~~~~~~~~~
29−
30−Entry points (hooks) define when a plugin runs. Right now only three hooks are implemented. So feel free to implement a hook if it fits the behaviour of your plugin.
31−
32−Pre search hook
33−```````````````
34−
35−Runs BEFORE the search request. Function to implement: ``pre_search``
36−
37−Post search hook
38−````````````````
39−
40−Runs AFTER the search request. Function to implement: ``post_search``
41−
42−Result hook
43−```````````
44−
45−Runs when a new result is added to the result list. Function to implement: ``on_result``
_sources/dev/quickstart.rst.txtnew file+132
@@ -0,0 +1,132 @@
1+.. _devquickstart:
2+
3+======================
4+Development Quickstart
5+======================
6+
7+.. sidebar:: :ref:`makefile`
8+
9+ For additional developer purpose there are :ref:`makefile`.
10+
11+This quickstart guide gets your environment set up with searx. Furthermore, it
12+gives a short introduction to the ``manage.sh`` script.
13+
14+How to setup your development environment
15+=========================================
16+
17+.. sidebar:: :ref:`make pyenv <make pyenv>`
18+
19+ Alternatively use the :ref:`make pyenv`.
20+
21+First, clone the source code of searx to the desired folder. In this case the
22+source is cloned to ``~/myprojects/searx``. Then create and activate the
23+searx-ve virtualenv and install the required packages using ``manage.sh``.
24+
25+.. code:: sh
26+
27+ cd ~/myprojects
28+ git clone https://github.com/asciimoo/searx.git
29+ cd searx
30+ virtualenv searx-ve
31+ . ./searx-ve/bin/activate
32+ ./manage.sh update_dev_packages
33+
34+
35+How to run tests
36+================
37+
38+.. sidebar:: :ref:`make test.unit <make test>`
39+
40+ Alternatively use the ``test.pep8``, ``test.unit``, ``test.robot`` targets.
41+
42+Tests can be run using the ``manage.sh`` script. Following tests and checks are
43+available:
44+
45+- Unit tests
46+- Selenium tests
47+- PEP8 validation
48+- Unit test coverage check
49+
50+For example unit tests are run with the command below:
51+
52+.. code:: sh
53+
54+ ./manage.sh unit_tests
55+
56+For further test options, please consult the help of the ``manage.sh`` script or
57+read :ref:`make test`.
58+
59+
60+How to compile styles and javascript
61+====================================
62+
63+.. _less: http://lesscss.org/
64+.. _NodeJS: https://nodejs.org
65+
66+How to build styles
67+-------------------
68+
69+Less_ is required to build the styles of searx. Less_ can be installed using
70+either NodeJS_ or Apt.
71+
72+.. code:: sh
73+
74+ sudo -H apt-get install nodejs
75+ sudo -H npm install -g less
76+
77+OR
78+
79+.. code:: sh
80+
81+ sudo -H apt-get install node-less
82+
83+After satisfying the requirements styles can be build using ``manage.sh``
84+
85+.. code:: sh
86+
87+ ./manage.sh styles
88+
89+
90+How to build the source of the oscar theme
91+==========================================
92+
93+.. _grunt: https://gruntjs.com/
94+
95+Grunt_ must be installed in order to build the javascript sources. It depends on
96+NodeJS, so first Node has to be installed.
97+
98+.. code:: sh
99+
100+ sudo -H apt-get install nodejs
101+ sudo -H npm install -g grunt-cli
102+
103+After installing grunt, the files can be built using the following command:
104+
105+.. code:: sh
106+
107+ ./manage.sh grunt_build
108+
109+
110+Tips for debugging/development
111+==============================
112+
113+.. sidebar:: :ref:`make run`
114+
115+ Makefile target ``run`` already enables debug option for your developer
116+ session / see :ref:`make run`.
117+
118+Turn on debug logging
119+ Whether you are working on a new engine or trying to eliminate a bug, it is
120+ always a good idea to turn on debug logging. When debug logging is enabled a
121+ stack trace appears, instead of the cryptic ``Internal Server Error``
122+ message. It can be turned on by setting ``debug: False`` to ``debug: True`` in
123+ :origin:`settings.yml <searx/settings.yml>`.
124+
125+.. sidebar:: :ref:`make test`
126+
127+ Alternatively use the :ref:`make test` targets.
128+
129+Run ``./manage.sh tests`` before creating a PR.
130+ Failing build on Travis is common because of PEP8 checks. So a new commit
131+ must be created containing these format fixes. This phase can be skipped if
132+ ``./manage.sh tests`` is run locally before creating a PR.
_sources/dev/quickstart.txtdeleted−108
@@ -1,108 +0,0 @@
1−.. _devquickstart:
2−
3−Development Quickstart
4−----------------------
5−
6−This quickstart guide gets your environment set up with searx. Furthermore, it gives a
7−short introduction to the new manage.sh script.
8−
9−How to setup your development environment
10−~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11−
12−First, clone the source code of searx to the desired folder. In this case the source
13−is cloned to ~/myprojects/searx. Then create and activate the searx-ve
14−virtualenv and install the required packages using manage.sh.
15−
16−.. code:: sh
17−
18− cd ~/myprojects
19− git clone https://github.com/asciimoo/searx.git
20− cd searx
21− virtualenv searx-ve
22− . ./searx-ve/bin/activate
23− ./manage.sh update_dev_packages
24−
25−
26−How to run tests
27−~~~~~~~~~~~~~~~~
28−
29−Tests can be run using the manage.sh script.
30−
31−Following tests and checks are available:
32−
33−- Unit tests
34−
35−- Selenium tests
36−
37−- PEP8 validation
38−
39−- Unit test coverage check
40−
41−For example unit tests are run with the command below:
42−
43−.. code:: sh
44−
45− ./manage.sh unit_tests
46−
47−For further test options, please consult the help of the manage.sh script.
48−
49−
50−How to compile styles and javascript
51−~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52−
53−How to build styles
54−^^^^^^^^^^^^^^^^^^^
55−
56−Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.
57−
58−.. code:: sh
59−
60− sudo apt-get install nodejs
61− sudo npm install -g less
62−
63−
64−OR
65−
66−.. code:: sh
67−
68− sudo apt-get install node-less
69−
70−After satisfying the requirements styles can be build using manage.sh
71−
72−.. code:: sh
73−
74− ./manage.sh styles
75−
76−
77−How to build the source of the oscar theme
78−^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79−
80−Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
81−Node has to be installed.
82−
83−.. code:: sh
84−
85− sudo apt-get install nodejs
86− sudo npm install -g grunt-cli
87−
88−After installing grunt, the files can be built using the following command:
89−
90−.. code:: sh
91−
92− ./manage.sh build_grunt
93−
94−
95−
96−Tips for debugging/development
97−~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98−
99−1. Turn on debug logging
100− Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
101− to turn on debug logging. When debug logging is enabled a stack trace appears,
102− instead of the cryptic ``Internal Server Error`` message. It can be turned on by setting
103− ``debug: False`` to ``debug: True`` in settings.yml.
104−
105−2. Run ``./manage.sh tests`` before creating a PR.
106− Failing build on Travis is common because of PEP8 checks. So a new commit must be created
107− containing these format fixes. This phase can be skipped if ``./manage.sh tests`` is run
108− locally before creating a PR.
_sources/dev/reST.rst.txtnew file+1428
@@ -0,0 +1,1428 @@
1+.. _reST primer:
2+
3+===========
4+reST primer
5+===========
6+
7+.. sidebar:: KISS_ and readability_
8+
9+ Instead of defining more and more roles, we at searx encourage our
10+ contributors to follow principles like KISS_ and readability_.
11+
12+We at searx are using reStructuredText (aka reST_) markup for all kind of
13+documentation, with the builders from the Sphinx_ project a HTML output is
14+generated and deployed at :docs:`github.io <.>`. For build prerequisites read
15+:ref:`docs build`.
16+
17+The source files of Searx's documentation are located at :origin:`docs`. Sphinx
18+assumes source files to be encoded in UTF-8 by defaul. Run :ref:`make docs-live
19+<make docs-live>` to build HTML while editing.
20+
21+.. sidebar:: Further reading
22+
23+ - Sphinx-Primer_
24+ - `Sphinx markup constructs`_
25+ - reST_, docutils_, `docutils FAQ`_
26+ - Sphinx_, `sphinx-doc FAQ`_
27+ - `sphinx config`_, doctree_
28+ - `sphinx cross references`_
29+ - linuxdoc_
30+ - intersphinx_
31+ - sphinx-jinja_
32+ - `Sphinx's autodoc`_
33+ - `Sphinx's Python domain`_, `Sphinx's C domain`_
34+ - SVG_, ImageMagick_
35+ - DOT_, `Graphviz's dot`_, Graphviz_
36+
37+
38+.. contents:: Contents
39+ :depth: 3
40+ :local:
41+ :backlinks: entry
42+
43+Sphinx_ and reST_ have their place in the python ecosystem. Over that reST is
44+used in popular projects, e.g the Linux kernel documentation `[kernel doc]`_.
45+
46+.. _[kernel doc]: https://www.kernel.org/doc/html/latest/doc-guide/sphinx.html
47+
48+.. sidebar:: Content matters
49+
50+ The readability_ of the reST sources has its value, therefore we recommend to
51+ make sparse usage of reST markup / .. content matters!
52+
53+**reST** is a plaintext markup language, its markup is *mostly* intuitive and
54+you will not need to learn much to produce well formed articles with. I use the
55+word *mostly*: like everything in live, reST has its advantages and
56+disadvantages, some markups feel a bit grumpy (especially if you are used to
57+other plaintext markups).
58+
59+Soft skills
60+===========
61+
62+Before going any deeper into the markup let's face on some **soft skills** a
63+trained author brings with, to reach a well feedback from readers:
64+
65+- Documentation is dedicated to an audience and answers questions from the
66+ audience point of view.
67+- Don't detail things which are general knowledge from the audience point of
68+ view.
69+- Limit the subject, use cross links for any further reading.
70+
71+To be more concrete what a *point of view* means. In the (:origin:`docs`)
72+folder we have three sections (and the *blog* folder), each dedicate to a
73+different group of audience.
74+
75+User's POV: :origin:`docs/user`
76+ A typical user knows about search engines and might have heard about
77+ meta crawlers and privacy.
78+
79+Admin's POV: :origin:`docs/admin`
80+ A typical Admin knows about setting up services on a linux system, but he does
81+ not know all the pros and cons of a searx setup.
82+
83+Developer's POV: :origin:`docs/dev`
84+ Depending on the readability_ of code, a typical developer is able to read and
85+ understand source code. Describe what a item aims to do (e.g. a function).
86+ If the chronological order matters, describe it. Name the *out-of-limits
87+ conditions* and all the side effects a external developer will not know.
88+
89+.. _reST inline markup:
90+
91+Basic inline markup
92+===================
93+
94+.. sidebar:: Inline markup
95+
96+ - :ref:`reST roles`
97+ - :ref:`reST smart ref`
98+
99+Basic inline markup is done with asterisks and backquotes. If asterisks or
100+backquotes appear in running text and could be confused with inline markup
101+delimiters, they have to be escaped with a backslash (``\*pointer``).
102+
103+.. table:: basic inline markup
104+ :widths: 4 3 7
105+
106+ ================================================ ==================== ========================
107+ description rendered markup
108+ ================================================ ==================== ========================
109+ one asterisk for emphasis *italics* ``*italics*``
110+ two asterisks for strong emphasis **boldface** ``**boldface**``
111+ backquotes for code samples and literals ``foo()`` ````foo()````
112+ quote asterisks or backquotes \*foo is a pointer ``\*foo is a pointer``
113+ ================================================ ==================== ========================
114+
115+.. _reST basic structure:
116+
117+Basic article structure
118+=======================
119+
120+The basic structure of an article makes use of heading adornments to markup
121+chapter, sections and subsections.
122+
123+.. _reST template:
124+
125+reST template
126+-------------
127+
128+reST template for an simple article:
129+
130+.. code:: reST
131+
132+ .. _doc refname:
133+
134+ ==============
135+ Document title
136+ ==============
137+
138+ Lorem ipsum dolor sit amet, consectetur adipisici elit .. Further read
139+ :ref:`chapter refname`.
140+
141+ .. _chapter refname:
142+
143+ Chapter
144+ =======
145+
146+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
147+ aliquid ex ea commodi consequat ...
148+
149+ .. _section refname:
150+
151+ Section
152+ -------
153+
154+ lorem ..
155+
156+ .. _subsection refname:
157+
158+ Subsection
159+ ~~~~~~~~~~
160+
161+ lorem ..
162+
163+
164+Headings
165+--------
166+
167+#. title - with overline for document title:
168+
169+ .. code:: reST
170+
171+ ==============
172+ Document title
173+ ==============
174+
175+
176+#. chapter - with anchor named ``anchor name``:
177+
178+ .. code:: reST
179+
180+ .. _anchor name:
181+
182+ Chapter
183+ =======
184+
185+#. section
186+
187+ .. code:: reST
188+
189+ Section
190+ -------
191+
192+#. subsection
193+
194+ .. code:: reST
195+
196+ Subsection
197+ ~~~~~~~~~~
198+
199+
200+
201+Anchors & Links
202+===============
203+
204+.. _reST anchor:
205+
206+Anchors
207+-------
208+
209+.. _ref role:
210+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref
211+
212+To refer a point in the documentation a anchor is needed. The :ref:`reST
213+template <reST template>` shows an example where a chapter titled *"Chapters"*
214+gets an anchor named ``chapter title``. Another example from *this* document,
215+where the anchor named ``reST anchor``:
216+
217+.. code:: reST
218+
219+ .. _reST anchor:
220+
221+ Anchors
222+ -------
223+
224+ To refer a point in the documentation a anchor is needed ...
225+
226+To refer anchors use the `ref role`_ markup:
227+
228+.. code:: reST
229+
230+ Visit chapter :ref:`reST anchor`. Or set hyperlink text manualy :ref:`foo
231+ bar <reST anchor>`.
232+
233+.. admonition:: ``:ref:`` role
234+ :class: rst-example
235+
236+ Visist chapter :ref:`reST anchor`. Or set hyperlink text manualy :ref:`foo
237+ bar <reST anchor>`.
238+
239+.. _reST ordinary ref:
240+
241+Link ordinary URL
242+-----------------
243+
244+If you need to reference external URLs use *named* hyperlinks to maintain
245+readability of reST sources. Here is a example taken from *this* article:
246+
247+.. code:: reST
248+
249+ .. _Sphinx Field Lists:
250+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html
251+
252+ With the *named* hyperlink `Sphinx Field Lists`_, the raw text is much more
253+ readable.
254+
255+ And this shows the alternative (less readable) hyperlink markup `Sphinx Field
256+ Lists
257+ <https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html>`__.
258+
259+.. admonition:: Named hyperlink
260+ :class: rst-example
261+
262+ With the *named* hyperlink `Sphinx Field Lists`_, the raw text is much more
263+ readable.
264+
265+ And this shows the alternative (less readable) hyperlink markup `Sphinx Field
266+ Lists
267+ <https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html>`__.
268+
269+
270+.. _reST smart ref:
271+
272+Smart refs
273+----------
274+
275+With the power of sphinx.ext.extlinks_ and intersphinx_ referencing external
276+content becomes smart.
277+
278+.. table:: smart refs with sphinx.ext.extlinks_ and intersphinx_
279+ :widths: 4 3 7
280+
281+ ========================== ================================== ====================================
282+ refer ... rendered example markup
283+ ========================== ================================== ====================================
284+ :rst:role:`rfc` :rfc:`822` ``:rfc:`822```
285+ :rst:role:`pep` :pep:`8` ``:pep:`8```
286+ sphinx.ext.extlinks_
287+ --------------------------------------------------------------------------------------------------
288+ project's wiki article :wiki:`Searx-instances` ``:wiki:`Searx-instances```
289+ to docs public URL :docs:`dev/reST.html` ``:docs:`dev/reST.html```
290+ files & folders origin :origin:`docs/dev/reST.rst` ``:origin:`docs/dev/reST.rst```
291+ pull request :pull:`1756` ``:pull:`1756```
292+ patch :patch:`af2cae6` ``:patch:`af2cae6```
293+ PyPi package :pypi:`searx` ``:pypi:`searx```
294+ manual page man :man:`bash` ``:man:`bash```
295+ intersphinx_
296+ --------------------------------------------------------------------------------------------------
297+ external anchor :ref:`python:and` ``:ref:`python:and```
298+ external doc anchor :doc:`jinja:templates` ``:doc:`jinja:templates```
299+ python code object :py:obj:`datetime.datetime` ``:py:obj:`datetime.datetime```
300+ flask code object :py:obj:`flask.Flask` ``:py:obj:`flask.Flask```
301+ ========================== ================================== ====================================
302+
303+
304+Intersphinx is configured in :origin:`docs/conf.py`:
305+
306+.. code:: python
307+
308+ intersphinx_mapping = {
309+ "python": ("https://docs.python.org/3/", None),
310+ "flask": ("https://flask.palletsprojects.com/", None),
311+ "jinja": ("https://jinja.palletsprojects.com/", None),
312+ "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
313+ "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
314+ }
315+
316+
317+To list all anchors of the inventory (e.g. ``python``) use:
318+
319+.. code:: sh
320+
321+ $ python -m sphinx.ext.intersphinx https://docs.python.org/3/objects.inv
322+
323+Literal blocks
324+==============
325+
326+The simplest form of :duref:`literal-blocks` is a indented block introduced by
327+two colons (``::``). For highlighting use :dudir:`highlight` or :ref:`reST
328+code` directive. To include literals from external files use directive
329+:dudir:`literalinclude`.
330+
331+.. _reST literal:
332+
333+``::``
334+------
335+
336+.. code:: reST
337+
338+ ::
339+
340+ Literal block
341+
342+ Lorem ipsum dolor::
343+
344+ Literal block
345+
346+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
347+ eirmod tempor invidunt ut labore ::
348+
349+ Literal block
350+
351+.. admonition:: Literal block
352+ :class: rst-example
353+
354+ ::
355+
356+ Literal block
357+
358+ Lorem ipsum dolor::
359+
360+ Literal block
361+
362+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
363+ eirmod tempor invidunt ut labore ::
364+
365+ Literal block
366+
367+
368+.. _reST code:
369+
370+``code-block``
371+--------------
372+
373+.. _pygments: https://pygments.org/languages/
374+
375+.. sidebar:: Syntax highlighting
376+
377+ is handled by pygments_.
378+
379+The :rst:dir:`code-block` directive is a variant of the :dudir:`code` directive
380+with additional options. To learn more about code literals visit
381+:ref:`sphinx:code-examples`.
382+
383+.. code-block:: reST
384+
385+ The URL ``/stats`` handle is shown in :ref:`stats-handle`
386+
387+ .. code-block:: Python
388+ :caption: python code block
389+ :name: stats-handle
390+
391+ @app.route('/stats', methods=['GET'])
392+ def stats():
393+ """Render engine statistics page."""
394+ stats = get_engines_stats()
395+ return render(
396+ 'stats.html'
397+ , stats = stats )
398+
399+.. code-block:: reST
400+
401+.. admonition:: Code block
402+ :class: rst-example
403+
404+ The URL ``/stats`` handle is shown in :ref:`stats-handle`
405+
406+ .. code-block:: Python
407+ :caption: python code block
408+ :name: stats-handle
409+
410+ @app.route('/stats', methods=['GET'])
411+ def stats():
412+ """Render engine statistics page."""
413+ stats = get_engines_stats()
414+ return render(
415+ 'stats.html'
416+ , stats = stats )
417+
418+Unicode substitution
419+====================
420+
421+The :dudir:`unicode directive <unicode-character-codes>` converts Unicode
422+character codes (numerical values) to characters. This directive can only be
423+used within a substitution definition.
424+
425+.. code-block:: reST
426+
427+ .. |copy| unicode:: 0xA9 .. copyright sign
428+ .. |(TM)| unicode:: U+2122
429+
430+ Trademark |(TM)| and copyright |copy| glyphs.
431+
432+.. admonition:: Unicode
433+ :class: rst-example
434+
435+ .. |copy| unicode:: 0xA9 .. copyright sign
436+ .. |(TM)| unicode:: U+2122
437+
438+ Trademark |(TM)| and copyright |copy| glyphs.
439+
440+
441+.. _reST roles:
442+
443+Roles
444+=====
445+
446+.. sidebar:: Further reading
447+
448+ - `Sphinx Roles`_
449+ - :doc:`sphinx:usage/restructuredtext/domains`
450+
451+
452+A *custom interpreted text role* (:duref:`ref <roles>`) is an inline piece of
453+explicit markup. It signifies that that the enclosed text should be interpreted
454+in a specific way.
455+
456+The general markup is one of:
457+
458+.. code:: reST
459+
460+ :rolename:`ref-name`
461+ :rolename:`ref text <ref-name>`
462+
463+.. table:: smart refs with sphinx.ext.extlinks_ and intersphinx_
464+ :widths: 4 3 7
465+
466+ ========================== ================================== ====================================
467+ role rendered example markup
468+ ========================== ================================== ====================================
469+ :rst:role:`guilabel` :guilabel:`&Cancel` ``:guilabel:`&Cancel```
470+ :rst:role:`kbd` :kbd:`C-x C-f` ``:kbd:`C-x C-f```
471+ :rst:role:`menuselection` :menuselection:`Open --> File` ``:menuselection:`Open --> File```
472+ :rst:role:`download` :download:`this file <reST.rst>` ``:download:`this file <reST.rst>```
473+ math_ :math:`a^2 + b^2 = c^2` ``:math:`a^2 + b^2 = c^2```
474+ :rst:role:`ref` :ref:`svg image example` ``:ref:`svg image example```
475+ :rst:role:`command` :command:`ls -la` ``:command:`ls -la```
476+ :durole:`emphasis` :emphasis:`italic` ``:emphasis:`italic```
477+ :durole:`strong` :strong:`bold` ``:strong:`bold```
478+ :durole:`literal` :literal:`foo()` ``:literal:`foo()```
479+ :durole:`subscript` H\ :sub:`2`\ O ``H\ :sub:`2`\ O``
480+ :durole:`superscript` E = mc\ :sup:`2` ``E = mc\ :sup:`2```
481+ :durole:`title-reference` :title:`Time` ``:title:`Time```
482+ ========================== ================================== ====================================
483+
484+Figures & Images
485+================
486+
487+.. sidebar:: Image processing
488+
489+ With the directives from :ref:`linuxdoc <linuxdoc:kfigure>` the build process
490+ is flexible. To get best results in the generated output format, install
491+ ImageMagick_ and Graphviz_.
492+
493+Searx's sphinx setup includes: :ref:`linuxdoc:kfigure`. Scaleable here means;
494+scaleable in sense of the build process. Normally in absence of a converter
495+tool, the build process will break. From the authors POV it’s annoying to care
496+about the build process when handling with images, especially since he has no
497+access to the build process. With :ref:`linuxdoc:kfigure` the build process
498+continues and scales output quality in dependence of installed image processors.
499+
500+If you want to add an image, you should use the ``kernel-figure`` (inheritance
501+of :dudir:`figure`) and ``kernel-image`` (inheritance of :dudir:`image`)
502+directives. E.g. to insert a figure with a scaleable image format use SVG
503+(:ref:`svg image example`):
504+
505+.. code:: reST
506+
507+ .. _svg image example:
508+
509+ .. kernel-figure:: svg_image.svg
510+ :alt: SVG image example
511+
512+ Simple SVG image
513+
514+ To refer the figure, a caption block is needed: :ref:`svg image example`.
515+
516+.. _svg image example:
517+
518+.. kernel-figure:: svg_image.svg
519+ :alt: SVG image example
520+
521+ Simple SVG image.
522+
523+To refer the figure, a caption block is needed: :ref:`svg image example`.
524+
525+DOT files (aka Graphviz)
526+------------------------
527+
528+With :ref:`linuxdoc:kernel-figure` reST support for **DOT** formatted files is
529+given.
530+
531+- `Graphviz's dot`_
532+- DOT_
533+- Graphviz_
534+
535+A simple example is shown in :ref:`dot file example`:
536+
537+.. code:: reST
538+
539+ .. _dot file example:
540+
541+ .. kernel-figure:: hello.dot
542+ :alt: hello world
543+
544+ DOT's hello world example
545+
546+.. admonition:: hello.dot
547+ :class: rst-example
548+
549+ .. _dot file example:
550+
551+ .. kernel-figure:: hello.dot
552+ :alt: hello world
553+
554+ DOT's hello world example
555+
556+``kernel-render`` DOT
557+---------------------
558+
559+Embed *render* markups (or languages) like Graphviz's **DOT** is provided by the
560+:ref:`linuxdoc:kernel-render` directive. A simple example of embedded DOT_ is
561+shown in figure :ref:`dot render example`:
562+
563+.. code:: reST
564+
565+ .. _dot render example:
566+
567+ .. kernel-render:: DOT
568+ :alt: digraph
569+ :caption: Embedded DOT (Graphviz) code
570+
571+ digraph foo {
572+ "bar" -> "baz";
573+ }
574+
575+ Attribute ``caption`` is needed, if you want to refer the figure: :ref:`dot
576+ render example`.
577+
578+Please note :ref:`build tools <linuxdoc:kfigure_build_tools>`. If Graphviz_ is
579+installed, you will see an vector image. If not, the raw markup is inserted as
580+*literal-block*.
581+
582+.. admonition:: kernel-render DOT
583+ :class: rst-example
584+
585+ .. _dot render example:
586+
587+ .. kernel-render:: DOT
588+ :alt: digraph
589+ :caption: Embedded DOT (Graphviz) code
590+
591+ digraph foo {
592+ "bar" -> "baz";
593+ }
594+
595+ Attribute ``caption`` is needed, if you want to refer the figure: :ref:`dot
596+ render example`.
597+
598+``kernel-render`` SVG
599+---------------------
600+
601+A simple example of embedded SVG_ is shown in figure :ref:`svg render example`:
602+
603+.. code:: reST
604+
605+ .. _svg render example:
606+
607+ .. kernel-render:: SVG
608+ :caption: Embedded **SVG** markup
609+ :alt: so-nw-arrow
610+..
611+
612+ .. code:: xml
613+
614+ <?xml version="1.0" encoding="UTF-8"?>
615+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
616+ baseProfile="full" width="70px" height="40px"
617+ viewBox="0 0 700 400"
618+ >
619+ <line x1="180" y1="370"
620+ x2="500" y2="50"
621+ stroke="black" stroke-width="15px"
622+ />
623+ <polygon points="585 0 525 25 585 50"
624+ transform="rotate(135 525 25)"
625+ />
626+ </svg>
627+
628+.. admonition:: kernel-render SVG
629+ :class: rst-example
630+
631+ .. _svg render example:
632+
633+ .. kernel-render:: SVG
634+ :caption: Embedded **SVG** markup
635+ :alt: so-nw-arrow
636+
637+ <?xml version="1.0" encoding="UTF-8"?>
638+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
639+ baseProfile="full" width="70px" height="40px"
640+ viewBox="0 0 700 400"
641+ >
642+ <line x1="180" y1="370"
643+ x2="500" y2="50"
644+ stroke="black" stroke-width="15px"
645+ />
646+ <polygon points="585 0 525 25 585 50"
647+ transform="rotate(135 525 25)"
648+ />
649+ </svg>
650+
651+
652+
653+
654+.. _reST lists:
655+
656+List markups
657+============
658+
659+Bullet list
660+-----------
661+
662+List markup (:duref:`ref <bullet-lists>`) is simple:
663+
664+.. code:: reST
665+
666+ - This is a bulleted list.
667+
668+ 1. Nested lists are possible, but be aware that they must be separated from
669+ the parent list items by blank line
670+ 2. Second item of nested list
671+
672+ - It has two items, the second
673+ item uses two lines.
674+
675+ #. This is a numbered list.
676+ #. It has two items too.
677+
678+.. admonition:: bullet list
679+ :class: rst-example
680+
681+ - This is a bulleted list.
682+
683+ 1. Nested lists are possible, but be aware that they must be separated from
684+ the parent list items by blank line
685+ 2. Second item of nested list
686+
687+ - It has two items, the second
688+ item uses two lines.
689+
690+ #. This is a numbered list.
691+ #. It has two items too.
692+
693+
694+Horizontal list
695+---------------
696+
697+The :rst:dir:`.. hlist:: <hlist>` transforms a bullet list into a more compact
698+list.
699+
700+.. code:: reST
701+
702+ .. hlist::
703+
704+ - first list item
705+ - second list item
706+ - third list item
707+ ...
708+
709+.. admonition:: hlist
710+ :class: rst-example
711+
712+ .. hlist::
713+
714+ - first list item
715+ - second list item
716+ - third list item
717+ - next list item
718+ - next list item xxxx
719+ - next list item yyyy
720+ - next list item zzzz
721+
722+
723+Definition list
724+---------------
725+
726+.. sidebar:: Note ..
727+
728+ - the term cannot have more than one line of text
729+
730+ - there is **no blank line between term and definition block** // this
731+ distinguishes definition lists (:duref:`ref <definition-lists>`) from block
732+ quotes (:duref:`ref <block-quotes>`).
733+
734+Each definition list (:duref:`ref <definition-lists>`) item contains a term,
735+optional classifiers and a definition. A term is a simple one-line word or
736+phrase. Optional classifiers may follow the term on the same line, each after
737+an inline ' : ' (**space, colon, space**). A definition is a block indented
738+relative to the term, and may contain multiple paragraphs and other body
739+elements. There may be no blank line between a term line and a definition block
740+(*this distinguishes definition lists from block quotes*). Blank lines are
741+required before the first and after the last definition list item, but are
742+optional in-between.
743+
744+Definition lists are created as follows:
745+
746+.. code:: reST
747+
748+ term 1 (up to a line of text)
749+ Definition 1.
750+
751+ See the typo : this line is not a term!
752+
753+ And this is not term's definition. **There is a blank line** in between
754+ the line above and this paragraph. That's why this paragraph is taken as
755+ **block quote** (:duref:`ref <block-quotes>`) and not as term's definition!
756+
757+ term 2
758+ Definition 2, paragraph 1.
759+
760+ Definition 2, paragraph 2.
761+
762+ term 3 : classifier
763+ Definition 3.
764+
765+ term 4 : classifier one : classifier two
766+ Definition 4.
767+
768+.. admonition:: definition list
769+ :class: rst-example
770+
771+ term 1 (up to a line of text)
772+ Definition 1.
773+
774+ See the typo : this line is not a term!
775+
776+ And this is not term's definition. **There is a blank line** in between
777+ the line above and this paragraph. That's why this paragraph is taken as
778+ **block quote** (:duref:`ref <block-quotes>`) and not as term's definition!
779+
780+
781+ term 2
782+ Definition 2, paragraph 1.
783+
784+ Definition 2, paragraph 2.
785+
786+ term 3 : classifier
787+ Definition 3.
788+
789+ term 4 : classifier one : classifier two
790+
791+
792+Quoted paragraphs
793+-----------------
794+
795+Quoted paragraphs (:duref:`ref <block-quotes>`) are created by just indenting
796+them more than the surrounding paragraphs. Line blocks (:duref:`ref
797+<line-blocks>`) are a way of preserving line breaks:
798+
799+.. code:: reST
800+
801+ normal paragraph ...
802+ lorem ipsum.
803+
804+ Quoted paragraph ...
805+ lorem ipsum.
806+
807+ | These lines are
808+ | broken exactly like in
809+ | the source file.
810+
811+
812+.. admonition:: Quoted paragraph and line block
813+ :class: rst-example
814+
815+ normal paragraph ...
816+ lorem ipsum.
817+
818+ Quoted paragraph ...
819+ lorem ipsum.
820+
821+ | These lines are
822+ | broken exactly like in
823+ | the source file.
824+
825+
826+.. _reST field list:
827+
828+Field Lists
829+-----------
830+
831+.. _Sphinx Field Lists:
832+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html
833+
834+.. sidebar:: bibliographic fields
835+
836+ First lines fields are bibliographic fields, see `Sphinx Field Lists`_.
837+
838+Field lists are used as part of an extension syntax, such as options for
839+directives, or database-like records meant for further processing. Field lists
840+are mappings from field names to field bodies. They marked up like this:
841+
842+.. code:: reST
843+
844+ :fieldname: Field content
845+ :foo: first paragraph in field foo
846+
847+ second paragraph in field foo
848+
849+ :bar: Field content
850+
851+.. admonition:: Field List
852+ :class: rst-example
853+
854+ :fieldname: Field content
855+ :foo: first paragraph in field foo
856+
857+ second paragraph in field foo
858+
859+ :bar: Field content
860+
861+
862+They are commonly used in Python documentation:
863+
864+.. code:: python
865+
866+ def my_function(my_arg, my_other_arg):
867+ """A function just for me.
868+
869+ :param my_arg: The first of my arguments.
870+ :param my_other_arg: The second of my arguments.
871+
872+ :returns: A message (just for me, of course).
873+ """
874+
875+Further list blocks
876+-------------------
877+
878+- field lists (:duref:`ref <field-lists>`, with caveats noted in
879+ :ref:`reST field list`)
880+- option lists (:duref:`ref <option-lists>`)
881+- quoted literal blocks (:duref:`ref <quoted-literal-blocks>`)
882+- doctest blocks (:duref:`ref <doctest-blocks>`)
883+
884+
885+Admonitions
886+===========
887+
888+Sidebar
889+-------
890+
891+Sidebar is an eye catcher, often used for admonitions pointing further stuff or
892+site effects. Here is the source of the sidebar :ref:`on top of this page <reST
893+primer>`.
894+
895+.. code:: reST
896+
897+ .. sidebar:: KISS_ and readability_
898+
899+ Instead of defining more and more roles, we at searx encourage our
900+ contributors to follow principles like KISS_ and readability_.
901+
902+Generic admonition
903+------------------
904+
905+The generic :dudir:`admonition <admonitions>` needs a title:
906+
907+.. code:: reST
908+
909+ .. admonition:: generic admonition title
910+
911+ lorem ipsum ..
912+
913+
914+.. admonition:: generic admonition title
915+
916+ lorem ipsum ..
917+
918+
919+Specific admonitions
920+--------------------
921+
922+Specific admonitions: :dudir:`hint`, :dudir:`note`, :dudir:`tip` :dudir:`attention`,
923+:dudir:`caution`, :dudir:`danger`, :dudir:`error`, , :dudir:`important`, and
924+:dudir:`warning` .
925+
926+.. code:: reST
927+
928+ .. hint::
929+
930+ lorem ipsum ..
931+
932+ .. note::
933+
934+ lorem ipsum ..
935+
936+ .. warning::
937+
938+ lorem ipsum ..
939+
940+
941+.. hint::
942+
943+ lorem ipsum ..
944+
945+.. note::
946+
947+ lorem ipsum ..
948+
949+.. tip::
950+
951+ lorem ipsum ..
952+
953+.. attention::
954+
955+ lorem ipsum ..
956+
957+.. caution::
958+
959+ lorem ipsum ..
960+
961+.. danger::
962+
963+ lorem ipsum ..
964+
965+.. important::
966+
967+ lorem ipsum ..
968+
969+.. error::
970+
971+ lorem ipsum ..
972+
973+.. warning::
974+
975+ lorem ipsum ..
976+
977+
978+Tables
979+======
980+
981+.. sidebar:: Nested tables
982+
983+ Nested tables are ugly! Not all builder support nested tables, don't use
984+ them!
985+
986+ASCII-art tables like :ref:`reST simple table` and :ref:`reST grid table` might
987+be comfortable for readers of the text-files, but they have huge disadvantages
988+in the creation and modifying. First, they are hard to edit. Think about
989+adding a row or a column to a ASCII-art table or adding a paragraph in a cell,
990+it is a nightmare on big tables.
991+
992+
993+.. sidebar:: List tables
994+
995+ For meaningful patch and diff use :ref:`reST flat table`.
996+
997+Second the diff of modifying ASCII-art tables is not meaningful, e.g. widening a
998+cell generates a diff in which also changes are included, which are only
999+ascribable to the ASCII-art. Anyway, if you prefer ASCII-art for any reason,
1000+here are some helpers:
1001+
1002+* `Emacs Table Mode`_
1003+* `Online Tables Generator`_
1004+
1005+.. _reST simple table:
1006+
1007+Simple tables
1008+-------------
1009+
1010+:duref:`Simple tables <simple-tables>` allow *colspan* but not *rowspan*. If
1011+your table need some metadata (e.g. a title) you need to add the ``.. table::
1012+directive`` :dudir:`(ref) <table>` in front and place the table in its body:
1013+
1014+.. code:: reST
1015+
1016+ .. table:: foo gate truth table
1017+ :widths: grid
1018+ :align: left
1019+
1020+ ====== ====== ======
1021+ Inputs Output
1022+ ------------- ------
1023+ A B A or B
1024+ ====== ====== ======
1025+ False
1026+ --------------------
1027+ True
1028+ --------------------
1029+ True False True
1030+ (foo)
1031+ ------ ------ ------
1032+ False True
1033+ (foo)
1034+ ====== =============
1035+
1036+.. admonition:: Simple ASCII table
1037+ :class: rst-example
1038+
1039+ .. table:: foo gate truth table
1040+ :widths: grid
1041+ :align: left
1042+
1043+ ====== ====== ======
1044+ Inputs Output
1045+ ------------- ------
1046+ A B A or B
1047+ ====== ====== ======
1048+ False
1049+ --------------------
1050+ True
1051+ --------------------
1052+ True False True
1053+ (foo)
1054+ ------ ------ ------
1055+ False True
1056+ (foo)
1057+ ====== =============
1058+
1059+
1060+
1061+.. _reST grid table:
1062+
1063+Grid tables
1064+-----------
1065+
1066+:duref:`Grid tables <grid-tables>` allow colspan *colspan* and *rowspan*:
1067+
1068+.. code:: reST
1069+
1070+ .. table:: grid table example
1071+ :widths: 1 1 5
1072+
1073+ +------------+------------+-----------+
1074+ | Header 1 | Header 2 | Header 3 |
1075+ +============+============+===========+
1076+ | body row 1 | column 2 | column 3 |
1077+ +------------+------------+-----------+
1078+ | body row 2 | Cells may span columns.|
1079+ +------------+------------+-----------+
1080+ | body row 3 | Cells may | - Cells |
1081+ +------------+ span rows. | - contain |
1082+ | body row 4 | | - blocks. |
1083+ +------------+------------+-----------+
1084+
1085+.. admonition:: ASCII grid table
1086+ :class: rst-example
1087+
1088+ .. table:: grid table example
1089+ :widths: 1 1 5
1090+
1091+ +------------+------------+-----------+
1092+ | Header 1 | Header 2 | Header 3 |
1093+ +============+============+===========+
1094+ | body row 1 | column 2 | column 3 |
1095+ +------------+------------+-----------+
1096+ | body row 2 | Cells may span columns.|
1097+ +------------+------------+-----------+
1098+ | body row 3 | Cells may | - Cells |
1099+ +------------+ span rows. | - contain |
1100+ | body row 4 | | - blocks. |
1101+ +------------+------------+-----------+
1102+
1103+
1104+.. _reST flat table:
1105+
1106+flat-table
1107+----------
1108+
1109+The ``flat-table`` is a further developed variant of the :ref:`list tables
1110+<linuxdoc:list-table-directives>`. It is a double-stage list similar to the
1111+:dudir:`list-table` with some additional features:
1112+
1113+column-span: ``cspan``
1114+ with the role ``cspan`` a cell can be extended through additional columns
1115+
1116+row-span: ``rspan``
1117+ with the role ``rspan`` a cell can be extended through additional rows
1118+
1119+auto-span:
1120+ spans rightmost cell of a table row over the missing cells on the right side
1121+ of that table-row. With Option ``:fill-cells:`` this behavior can changed
1122+ from *auto span* to *auto fill*, which automatically inserts (empty) cells
1123+ instead of spanning the last cell.
1124+
1125+options:
1126+ :header-rows: [int] count of header rows
1127+ :stub-columns: [int] count of stub columns
1128+ :widths: [[int] [int] ... ] widths of columns
1129+ :fill-cells: instead of auto-span missing cells, insert missing cells
1130+
1131+roles:
1132+ :cspan: [int] additional columns (*morecols*)
1133+ :rspan: [int] additional rows (*morerows*)
1134+
1135+The example below shows how to use this markup. The first level of the staged
1136+list is the *table-row*. In the *table-row* there is only one markup allowed,
1137+the list of the cells in this *table-row*. Exception are *comments* ( ``..`` )
1138+and *targets* (e.g. a ref to :ref:`row 2 of table's body <row body 2>`).
1139+
1140+.. code:: reST
1141+
1142+ .. flat-table:: ``flat-table`` example
1143+ :header-rows: 2
1144+ :stub-columns: 1
1145+ :widths: 1 1 1 1 2
1146+
1147+ * - :rspan:`1` head / stub
1148+ - :cspan:`3` head 1.1-4
1149+
1150+ * - head 2.1
1151+ - head 2.2
1152+ - head 2.3
1153+ - head 2.4
1154+
1155+ * .. row body 1 / this is a comment
1156+
1157+ - row 1
1158+ - :rspan:`2` cell 1-3.1
1159+ - cell 1.2
1160+ - cell 1.3
1161+ - cell 1.4
1162+
1163+ * .. Comments and targets are allowed on *table-row* stage.
1164+ .. _`row body 2`:
1165+
1166+ - row 2
1167+ - cell 2.2
1168+ - :rspan:`1` :cspan:`1`
1169+ cell 2.3 with a span over
1170+
1171+ * col 3-4 &
1172+ * row 2-3
1173+
1174+ * - row 3
1175+ - cell 3.2
1176+
1177+ * - row 4
1178+ - cell 4.1
1179+ - cell 4.2
1180+ - cell 4.3
1181+ - cell 4.4
1182+
1183+ * - row 5
1184+ - cell 5.1 with automatic span to rigth end
1185+
1186+ * - row 6
1187+ - cell 6.1
1188+ - ..
1189+
1190+
1191+.. admonition:: List table
1192+ :class: rst-example
1193+
1194+ .. flat-table:: ``flat-table`` example
1195+ :header-rows: 2
1196+ :stub-columns: 1
1197+ :widths: 1 1 1 1 2
1198+
1199+ * - :rspan:`1` head / stub
1200+ - :cspan:`3` head 1.1-4
1201+
1202+ * - head 2.1
1203+ - head 2.2
1204+ - head 2.3
1205+ - head 2.4
1206+
1207+ * .. row body 1 / this is a comment
1208+
1209+ - row 1
1210+ - :rspan:`2` cell 1-3.1
1211+ - cell 1.2
1212+ - cell 1.3
1213+ - cell 1.4
1214+
1215+ * .. Comments and targets are allowed on *table-row* stage.
1216+ .. _`row body 2`:
1217+
1218+ - row 2
1219+ - cell 2.2
1220+ - :rspan:`1` :cspan:`1`
1221+ cell 2.3 with a span over
1222+
1223+ * col 3-4 &
1224+ * row 2-3
1225+
1226+ * - row 3
1227+ - cell 3.2
1228+
1229+ * - row 4
1230+ - cell 4.1
1231+ - cell 4.2
1232+ - cell 4.3
1233+ - cell 4.4
1234+
1235+ * - row 5
1236+ - cell 5.1 with automatic span to rigth end
1237+
1238+ * - row 6
1239+ - cell 6.1
1240+ - ..
1241+
1242+
1243+CSV table
1244+---------
1245+
1246+CSV table might be the choice if you want to include CSV-data from a outstanding
1247+(build) process into your documentation.
1248+
1249+.. code:: reST
1250+
1251+ .. csv-table:: CSV table example
1252+ :header: .. , Column 1, Column 2
1253+ :widths: 2 5 5
1254+ :stub-columns: 1
1255+ :file: csv_table.txt
1256+
1257+Content of file ``csv_table.txt``:
1258+
1259+.. literalinclude:: csv_table.txt
1260+
1261+.. admonition:: CSV table
1262+ :class: rst-example
1263+
1264+ .. csv-table:: CSV table example
1265+ :header: .. , Column 1, Column 2
1266+ :widths: 3 5 5
1267+ :stub-columns: 1
1268+ :file: csv_table.txt
1269+
1270+Templating
1271+==========
1272+
1273+.. sidebar:: Build environment
1274+
1275+ All *generic-doc* tasks are running in the :ref:`build environment <make
1276+ pyenv>`.
1277+
1278+Templating is suitable for documentation which is created generic at the build
1279+time. The sphinx-jinja_ extension evaluates jinja_ templates in the :ref:`build
1280+environment <make pyenv>` (with searx modules installed). We use this e.g. to
1281+build chapter: :ref:`engines generic`. Below the jinja directive from the
1282+:origin:`docs/admin/engines.rst` is shown:
1283+
1284+.. literalinclude:: ../admin/engines.rst
1285+ :language: reST
1286+ :start-after: .. _configured engines:
1287+
1288+The context for the template is selected in the line ``.. jinja:: webapp``. In
1289+sphinx's build configuration (:origin:`docs/conf.py`) the ``webapp`` context
1290+points to the name space of the python module: ``webapp``.
1291+
1292+.. code:: py
1293+
1294+ from searx import webapp
1295+ jinja_contexts = {
1296+ 'webapp': dict(**webapp.__dict__)
1297+ }
1298+
1299+
1300+Tabbed views
1301+============
1302+
1303+.. _sphinx-tabs: https://github.com/djungelorm/sphinx-tabs
1304+.. _basic-tabs: https://github.com/djungelorm/sphinx-tabs#basic-tabs
1305+.. _group-tabs: https://github.com/djungelorm/sphinx-tabs#group-tabs
1306+.. _code-tabs: https://github.com/djungelorm/sphinx-tabs#code-tabs
1307+
1308+With `sphinx-tabs`_ extension we have *tabbed views*. To provide installation
1309+instructions with one tab per distribution we use the `group-tabs`_ directive,
1310+others are basic-tabs_ and code-tabs_. Below a *group-tab* example from
1311+:ref:`docs build` is shown:
1312+
1313+.. literalinclude:: ../admin/buildhosts.rst
1314+ :language: reST
1315+ :start-after: .. _system requirements:
1316+ :end-before: .. _system requirements END:
1317+
1318+
1319+.. _math:
1320+
1321+Math equations
1322+==============
1323+
1324+.. _Mathematics: https://en.wikibooks.org/wiki/LaTeX/Mathematics
1325+.. _amsmath user guide:
1326+ http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/macros/latex/required/amsmath/amsldoc.pdf
1327+
1328+.. sidebar:: About LaTeX
1329+
1330+ - `amsmath user guide`_
1331+ - Mathematics_
1332+ - :ref:`docs build`
1333+
1334+The input language for mathematics is LaTeX markup using the :ctan:`amsmath`
1335+package.
1336+
1337+To embed LaTeX markup in reST documents, use role :rst:role:`:math: <math>` for
1338+inline and directive :rst:dir:`.. math:: <math>` for block markup.
1339+
1340+.. code:: reST
1341+
1342+ In :math:numref:`schroedinger general` the time-dependent Schrödinger equation
1343+ is shown.
1344+
1345+ .. math::
1346+ :label: schroedinger general
1347+
1348+ \mathrm{i}\hbar\dfrac{\partial}{\partial t} |\,\psi (t) \rangle =
1349+ \hat{H} |\,\psi (t) \rangle.
1350+
1351+.. admonition:: LaTeX math equation
1352+ :class: rst-example
1353+
1354+ In :math:numref:`schroedinger general` the time-dependent Schrödinger equation
1355+ is shown.
1356+
1357+ .. math::
1358+ :label: schroedinger general
1359+
1360+ \mathrm{i}\hbar\dfrac{\partial}{\partial t} |\,\psi (t) \rangle =
1361+ \hat{H} |\,\psi (t) \rangle.
1362+
1363+
1364+The next example shows the difference of ``\tfrac`` (*textstyle*) and ``\dfrac``
1365+(*displaystyle*) used in a inline markup or another fraction.
1366+
1367+.. code:: reST
1368+
1369+ ``\tfrac`` **inline example** :math:`\tfrac{\tfrac{1}{x}+\tfrac{1}{y}}{y-z}`
1370+ ``\dfrac`` **inline example** :math:`\dfrac{\dfrac{1}{x}+\dfrac{1}{y}}{y-z}`
1371+
1372+.. admonition:: Line spacing
1373+ :class: rst-example
1374+
1375+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
1376+ eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
1377+ voluptua. ...
1378+ ``\tfrac`` **inline example** :math:`\tfrac{\tfrac{1}{x}+\tfrac{1}{y}}{y-z}`
1379+ At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
1380+ gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
1381+
1382+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
1383+ eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
1384+ voluptua. ...
1385+ ``\tfrac`` **inline example** :math:`\dfrac{\dfrac{1}{x}+\dfrac{1}{y}}{y-z}`
1386+ At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
1387+ gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
1388+
1389+
1390+.. _KISS: https://en.wikipedia.org/wiki/KISS_principle
1391+
1392+.. _readability: https://docs.python-guide.org/writing/style/
1393+.. _Sphinx-Primer:
1394+ http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
1395+.. _reST: https://docutils.sourceforge.io/rst.html
1396+.. _Sphinx Roles:
1397+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html
1398+.. _Sphinx: http://www.sphinx-doc.org
1399+.. _`sphinx-doc FAQ`: http://www.sphinx-doc.org/en/stable/faq.html
1400+.. _Sphinx markup constructs:
1401+ http://www.sphinx-doc.org/en/stable/markup/index.html
1402+.. _`sphinx cross references`:
1403+ http://www.sphinx-doc.org/en/stable/markup/inline.html#cross-referencing-arbitrary-locations
1404+.. _sphinx.ext.extlinks:
1405+ https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
1406+.. _intersphinx: http://www.sphinx-doc.org/en/stable/ext/intersphinx.html
1407+.. _sphinx config: http://www.sphinx-doc.org/en/stable/config.html
1408+.. _Sphinx's autodoc: http://www.sphinx-doc.org/en/stable/ext/autodoc.html
1409+.. _Sphinx's Python domain:
1410+ http://www.sphinx-doc.org/en/stable/domains.html#the-python-domain
1411+.. _Sphinx's C domain:
1412+ http://www.sphinx-doc.org/en/stable/domains.html#cross-referencing-c-constructs
1413+.. _doctree:
1414+ http://www.sphinx-doc.org/en/master/extdev/tutorial.html?highlight=doctree#build-phases
1415+.. _docutils: http://docutils.sourceforge.net/docs/index.html
1416+.. _docutils FAQ: http://docutils.sourceforge.net/FAQ.html
1417+.. _linuxdoc: https://return42.github.io/linuxdoc
1418+.. _jinja: https://jinja.palletsprojects.com/
1419+.. _sphinx-jinja: https://github.com/tardyp/sphinx-jinja
1420+.. _SVG: https://www.w3.org/TR/SVG11/expanded-toc.html
1421+.. _DOT: https://graphviz.gitlab.io/_pages/doc/info/lang.html
1422+.. _`Graphviz's dot`: https://graphviz.gitlab.io/_pages/pdf/dotguide.pdf
1423+.. _Graphviz: https://graphviz.gitlab.io
1424+.. _ImageMagick: https://www.imagemagick.org
1425+
1426+.. _`Emacs Table Mode`: https://www.emacswiki.org/emacs/TableMode
1427+.. _`Online Tables Generator`: http://www.tablesgenerator.com/text_tables
1428+.. _`OASIS XML Exchange Table Model`: https://www.oasis-open.org/specs/tm9901.html
_sources/dev/search_api.rst.txtnew file+119
@@ -0,0 +1,119 @@
1+==========
2+Search API
3+==========
4+
5+The search supports both ``GET`` and ``POST``.
6+
7+Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
8+
9+
10+``GET /``
11+
12+``GET /search``
13+
14+Parameters
15+==========
16+
17+.. sidebar:: Further reading ..
18+
19+ - :ref:`engines generic`
20+ - :ref:`configured engines`
21+ - :ref:`engine settings`
22+ - :ref:`engine file`
23+
24+``q`` : required
25+ The search query. This string is passed to external search services. Thus,
26+ searx supports syntax of each search service. For example, ``site:github.com
27+ searx`` is a valid query for Google. However, if simply the query above is
28+ passed to any search engine which does not filter its results based on this
29+ syntax, you might not get the results you wanted.
30+
31+ See more at :ref:`search-syntax`
32+
33+``categories`` : optional
34+ Comma separated list, specifies the active search categories
35+
36+``engines``: optional
37+ Comma separated list, specifies the active search engines.
38+
39+``lang``: default ``all``
40+ Code of the language.
41+
42+``pageno``: default ``1``
43+ Search page number.
44+
45+``time_range``: optional
46+ [ ``day``, ``month``, ``year`` ]
47+
48+ Time range of search for engines which support it. See if an engine supports
49+ time range search in the preferences page of an instance.
50+
51+``format``: optional
52+ [ ``json``, ``csv``, ``rss`` ]
53+
54+ Output format of results.
55+
56+``results_on_new_tab``: default ``0``
57+ [ ``0``, ``1`` ]
58+
59+ Open search results on new tab.
60+
61+``image_proxy``: default ``False``
62+ [ ``True``, ``False`` ]
63+
64+ Proxy image results through searx.
65+
66+``autocomplete``: default *empty*
67+ [ ``google``, ``dbpedia``, ``duckduckgo``, ``startpage``, ``wikipedia`` ]
68+
69+ Service which completes words as you type.
70+
71+``safesearch``: default ``None``
72+ [ ``0``, ``1``, ``None`` ]
73+
74+ Filter search results of engines which support safe search. See if an engine
75+ supports safe search in the preferences page of an instance.
76+
77+``theme``: default ``oscar``
78+ [ ``oscar``, ``simple``, ``legacy``, ``pix-art``, ``courgette`` ]
79+
80+ Theme of instance.
81+
82+ Please note, available themes depend on an instance. It is possible that an
83+ instance administrator deleted, created or renamed themes on his/her instance.
84+ See the available options in the preferences page of the instance.
85+
86+``oscar-style``: default ``logicodev``
87+ [ ``pointhi``, ``logicodev`` ]
88+
89+ Style of Oscar theme. It is only parsed if the theme of an instance is
90+ ``oscar``.
91+
92+ Please note, available styles depend on an instance. It is possible that an
93+ instance administrator deleted, created or renamed styles on his/her
94+ instance. See the available options in the preferences page of the instance.
95+
96+``enabled_plugins``: optional
97+ List of enabled plugins.
98+
99+ :default: ``HTTPS_rewrite``, ``Self_Informations``,
100+ ``Search_on_category_select``, ``Tracker_URL_remover``
101+
102+ :values: [ ``DOAI_rewrite``, ``HTTPS_rewrite``, ``Infinite_scroll``,
103+ ``Vim-like_hotkeys``, ``Self_Informations``, ``Tracker_URL_remover``,
104+ ``Search_on_category_select`` ]
105+
106+``disabled_plugins``: optional
107+ List of disabled plugins.
108+
109+ :default: ``DOAI_rewrite``, ``Infinite_scroll``, ``Vim-like_hotkeys``
110+ :values: ``DOAI_rewrite``, ``HTTPS_rewrite``, ``Infinite_scroll``,
111+ ``Vim-like_hotkeys``, ``Self_Informations``, ``Tracker_URL_remover``,
112+ ``Search_on_category_select``
113+
114+``enabled_engines``: optional : *all* :origin:`engines <searx/engines>`
115+ List of enabled engines.
116+
117+``disabled_engines``: optional : *all* :origin:`engines <searx/engines>`
118+ List of disabled engines.
119+
_sources/dev/search_api.txtdeleted−35
@@ -1,35 +0,0 @@
1−Search API
2−==========
3−
4−The search supports both ``GET`` and ``POST``.
5−
6−Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
7−
8−.. code:: sh
9−
10− GET /
11−
12−.. code:: sh
13−
14− GET /search
15−
16−Parameters
17−``````````
18−
19−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
20−| Name | Description | |
21−+==================+====================================================================================================+==================================================+
22−| ``q`` | The search query, see :doc:`/user/search_syntax` | required |
23−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
24−| ``categories`` | Comma separated list, specifies the active search categories | optional |
25−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
26−| ``engines`` | Comma separated list, specifies the active search engines | optional |
27−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
28−| ``lang`` | Code of the language | optional (default: ``all``) |
29−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
30−| ``pageno`` | Search page number | optional (default: ``1``) |
31−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
32−| ``time_range`` | Time range of search | optional (possible: ``day``, ``month``, ``year``)|
33−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
34−| ``format`` | Output format of results | optional (possible: ``json``, ``csv``, ``rss``) |
35−+------------------+----------------------------------------------------------------------------------------------------+--------------------------------------------------+
_sources/dev/translation.txt → _sources/dev/translation.rst.txtrenamed+27−17
@@ -1,28 +1,36 @@
1+.. _translation:
2+
3+===========
14Translation
25===========
36
4−Requirements
5−------------
7+.. _searx@transifex: https://www.transifex.com/asciimoo/searx/
8+
9+Translation currently takes place on `searx@transifex`_
610
7− * Transifex account
11+Requirements
12+============
813
9− * Installed CLI tool of Transifex
14+* Transifex account
15+* Installed CLI tool of Transifex
1016
1117Init Transifex project
12−----------------------
18+======================
1319
14−After installing ``transifex`` using pip, run the following command to initialize the project.
20+After installing ``transifex`` using pip, run the following command to
21+initialize the project.
1522
16−.. code:: shell
23+.. code:: sh
1724
18− tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/
25+ tx init # Transifex instance: https://www.transifex.com/asciimoo/searx/
1926
2027
21−After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it into the configuration file.
28+After ``$HOME/.transifexrc`` is created, get a Transifex API key and insert it
29+into the configuration file.
2230
2331Create a configuration file for ``tx`` named ``$HOME/.tx/config``.
2432
25−.. code:: shell
33+.. code:: ini
2634
2735 [main]
2836 host = https://www.transifex.com
@@ -42,20 +50,22 @@ Then run ``tx set``:
4250
4351
4452Update translations
45−-------------------
53+===================
4654
4755To retrieve the latest translations, pull it from Transifex.
4856
49−.. code:: shell
57+.. code:: sh
5058
51− tx pull -a
59+ tx pull -a
5260
53−Then check the new languages. If strings translated are not enough, delete those folders, because
54−those should not be compiled. Call the command below to compile the ``.po`` files.
61+Then check the new languages. If strings translated are not enough, delete those
62+folders, because those should not be compiled. Call the command below to compile
63+the ``.po`` files.
5564
5665.. code:: shell
5766
58− pybabel compile -d searx/translations
67+ pybabel compile -d searx/translations
5968
6069
61−After the compilation is finished commit the ``.po`` and ``.mo`` files and create a PR.
70+After the compilation is finished commit the ``.po`` and ``.mo`` files and
71+create a PR.
_sources/index.rst.txtnew file+32
@@ -0,0 +1,32 @@
1+================
2+Welcome to searx
3+================
4+
5+Search without being tracked.
6+
7+.. sidebar:: Features
8+
9+ - Self hosted
10+ - No user tracking
11+ - No user profiling
12+ - About 70 supported search engines
13+ - Easy integration with any search engine
14+ - Cookies are not used by default
15+ - Secure, encrypted connections (HTTPS/SSL)
16+ - Hosted by organizations, such as *La Quadrature du Net*, which promote
17+ digital rights
18+
19+Searx is a free internet metasearch engine which aggregates results from more
20+than 70 search services. Users are neither tracked nor profiled. Additionally,
21+searx can be used over Tor for online anonymity.
22+
23+Get started with searx by using one of the :wiki:`Searx-instances`. If you
24+don't trust anyone, you can set up your own, see :ref:`installation`.
25+
26+.. toctree::
27+ :maxdepth: 2
28+
29+ user/index
30+ admin/index
31+ dev/index
32+ blog/index
_sources/index.txtdeleted−55
@@ -1,55 +0,0 @@
1−Welcome to searx
2−================
3−
4−Search without being tracked.
5−
6−Searx is a free internet metasearch engine which aggregates results from more than 70 search services. Users are neither tracked nor profiled. Additionally, searx can be used over Tor for online anonymity.
7−
8−Get started with searx by using one of the `public instances`_. If you don't trust anyone, you can set up your own, see :ref:`installation`.
9−
10−.. _public instances: https://github.com/asciimoo/searx/wiki/Searx-instances
11−
12−Features
13−--------
14−
15− - Self hosted
16− - No user tracking
17− - No user profiling
18− - About 70 supported search engines
19− - Easy integration with any search engine
20− - Cookies are not used by default
21− - Secure, encrypted connections (HTTPS/SSL)
22− - Hosted by organisations, such as La Quadrature du Net, which promote digital rights
23−
24−
25−User documentation
26−------------------
27−
28−.. toctree::
29− :maxdepth: 1
30−
31− user/search_syntax
32− user/own-instance
33−
34−Administrator documentation
35−---------------------------
36−
37−.. toctree::
38− :maxdepth: 1
39−
40− dev/install/installation
41− admin/api
42− admin/filtron
43−
44−Developer documentation
45−-----------------------
46−
47−.. toctree::
48− :maxdepth: 1
49−
50− dev/quickstart
51− dev/contribution_guide
52− dev/engine_overview
53− dev/search_api
54− dev/plugins
55− dev/translation
_sources/user/index.rst.txtnew file+9
@@ -0,0 +1,9 @@
1+==================
2+User documentation
3+==================
4+
5+.. toctree::
6+ :maxdepth: 1
7+
8+ search_syntax
9+ own-instance
_sources/user/own-instance.rst.txtnew file+77
@@ -0,0 +1,77 @@
1+===========================
2+Why use a private instance?
3+===========================
4+
5+"Is it worth to run my own instance?" is a common question among searx users.
6+Before answering this question, see what options a searx user has.
7+
8+Public instances are open to everyone who has access to its URL. Usually, these
9+are operated by unknown parties (from the users' point of view). Private
10+instances can be used by a select group of people. It is for example a searx of
11+group of friends or a company which can be accessed through VPN. Also it can be
12+single user one which runs on the user's laptop.
13+
14+To gain more insight on how these instances work let's dive into how searx
15+protects its users.
16+
17+How does searx protect privacy?
18+===============================
19+
20+Searx protects the privacy of its users in multiple ways regardless of the type
21+of the instance (private, public). Removal of private data from search requests
22+comes in three forms:
23+
24+ 1. removal of private data from requests going to search services
25+ 2. not forwarding anything from a third party services through search services
26+ (e.g. advertisement)
27+ 3. removal of private data from requests going to the result pages
28+
29+Removing private data means not sending cookies to external search engines and
30+generating a random browser profile for every request. Thus, it does not matter
31+if a public or private instance handles the request, because it is anonymized in
32+both cases. IP addresses will be the IP of the instance. But searx can be
33+configured to use proxy or Tor. `Result proxy
34+<https://github.com/asciimoo/morty>`__ is supported, too.
35+
36+Searx does not serve ads or tracking content unlike most search services. So
37+private data is not forwarded to third parties who might monetize it. Besides
38+protecting users from search services, both referring page and search query are
39+hidden from visited result pages.
40+
41+
42+What are the consequences of using public instances?
43+----------------------------------------------------
44+
45+If someone uses a public instance, he/she has to trust the administrator of that
46+instance. This means that the user of the public instance does not know whether
47+his/her requests are logged, aggregated and sent or sold to a third party.
48+
49+Also, public instances without proper protection are more vulnerable to abusing
50+the search service, In this case the external service in exchange returns
51+CAPTCHAs or bans the IP of the instance. Thus, search requests return less
52+results.
53+
54+I see. What about private instances?
55+------------------------------------
56+
57+If users run their own instances, everything is in their control: the source
58+code, logging settings and private data. Unknown instance administrators do not
59+have to be trusted.
60+
61+Furthermore, as the default settings of their instance is editable, there is no
62+need to use cookies to tailor searx to their needs. So preferences will not be
63+reset to defaults when clearing browser cookies. As settings are stored on
64+their computer, it will not be accessible to others as long as their computer is
65+not compromised.
66+
67+Conclusion
68+==========
69+
70+Always use an instance which is operated by people you trust. The privacy
71+features of searx are available to users no matter what kind of instance they
72+use.
73+
74+If someone is on the go or just wants to try searx for the first time public
75+instances are the best choices. Additionally, public instance are making a
76+world a better place, because those who cannot or do not want to run an
77+instance, have access to a privacy respecting search service.
_sources/user/own-instance.txtdeleted−43
@@ -1,43 +0,0 @@
1−Why use a private instance?
2−===========================
3−
4−"Is it worth to run my own instance?" is a common question among searx users. Before answering this question, see what options a searx user has.
5−
6−Public instances are open to everyone who has access to its URL. Usually, these are operated by unknown parties (from the users' point of view). Private instances can be used by a select group of people. It is for example a searx of group of friends or a company which can be accessed through VPN. Also it can be single user one which runs on the user's laptop.
7−
8−To gain more insight on how these instances work let's dive into how searx protects its users.
9−
10−How does searx protect privacy?
11−-------------------------------
12−
13−Searx protects the privacy of its users in multiple ways regardless of the type of the instance (private, public). Removal of private data from search requests comes in three forms:
14−
15− 1. removal of private data from requests going to search services
16− 2. not forwarding anything from a third party services through search services (e.g. advertisement)
17− 3. removal of private data from requests going to the result pages
18−
19−Removing private data means not sending cookies to external search engines and generating a random browser profile for every request. Thus, it does not matter if a public or private instance handles the request, because it is anonymized in both cases. IP addresses will be the IP of the instance. But searx can be configured to use proxy or Tor. `Result proxy <https://github.com/asciimoo/morty>`__ is supported, too.
20−
21−Searx does not serve ads or tracking content unlike most search services. So private data is not forwarded to third parties who might monetize it. Besides protecting users from search services, both referring page and search query are hidden from visited result pages.
22−
23−What are the consequences of using public instances?
24−^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25−
26−If someone uses a public instance, he/she has to trust the administrator of that instance.
27−This means that the user of the public instance does not know whether his/her requests are logged, aggregated and sent or sold to a third party.
28−
29−Also, public instances without proper protection are more vulnerable to abusing the search service, In this case the external service in exchange returns CAPTCHAs or bans the IP of the instance. Thus, search requests return less results.
30−
31−I see. What about private instances?
32−^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33−
34−If users run their own instances, everything is in their control: the source code, logging settings and private data. Unknown instance administrators do not have to be trusted.
35−
36−Furthermore, as the default settings of their instance is editable, there is no need to use cookies to tailor searx to their needs. So preferences will not be reset to defaults when clearing browser cookies. As settings are stored on their computer, it will not be accessible to others as long as their computer is not compromised.
37−
38−Conclusion
39−----------
40−
41−Always use an instance which is operated by people you trust. The privacy features of searx are available to users no matter what kind of instance they use.
42−
43−If someone is on the go or just wants to try searx for the first time public instances are the best choices. Additionally, public instance are making a world a better place, because those who cannot or do not want to run an instance, have access to a privacy respecting search service.
_sources/user/search_syntax.rst.txtnew file+42
@@ -0,0 +1,42 @@
1+
2+.. _search-syntax:
3+
4+=============
5+Search syntax
6+=============
7+
8+Searx allows you to modify the default categories, engines and search language
9+via the search query.
10+
11+Prefix ``!``
12+ to set Category/engine
13+
14+Prefix: ``:``
15+ to set language
16+
17+Prefix: ``?``
18+ to add engines and categories to the currently selected categories
19+
20+Abbrevations of the engines and languages are also accepted. Engine/category
21+modifiers are chainable and inclusive (e.g. with :search:`!it !ddg !wp qwer
22+<?q=%21it%20%21ddg%20%21wp%20qwer>` search in IT category **and** duckduckgo
23+**and** wikipedia for ``qwer``).
24+
25+See the :search:`/preferences page <preferences>` for the list of engines,
26+categories and languages.
27+
28+Examples
29+========
30+
31+Search in wikipedia for ``qwer``:
32+
33+- :search:`!wp qwer <?q=%21wp%20qwer>` or
34+- :search:`!wikipedia qwer :search:<?q=%21wikipedia%20qwer>`
35+
36+Image search:
37+
38+- :search:`!images Cthulhu <?q=%21images%20Cthulhu>`
39+
40+Custom language in wikipedia:
41+
42+- :search:`:hu !wp hackerspace <?q=%3Ahu%20%21wp%20hackerspace>`
_sources/user/search_syntax.txtdeleted−33
@@ -1,33 +0,0 @@
1−Search syntax
2−=============
3−
4−Searx allows you to modify the default categories, engines and search
5−language via the search query.
6−
7−Category/engine prefix: ``!``
8−
9−Language prefix: ``:``
10−
11−Prefix to add engines and categories to the currently selected
12−categories: ``?``
13−
14−Abbrevations of the engines and languages are also accepted.
15−Engine/category modifiers are chainable and inclusive (e.g. with
16−`!it !ddg !wp qwer <https://searx.me/?q=%21it%20%21ddg%20%21wp%20qwer>`_
17−search in IT category **and** duckduckgo **and** wikipedia for ``qwer``).
18−
19−See the `/preferences page <https://searx.me/preferences>`_ for the
20−list of engines, categories and languages.
21−
22−Examples
23−~~~~~~~~
24−
25−Search in wikipedia for ``qwer``:
26−`!wp qwer <https://searx.me/?q=%21wp%20qwer>`__ or
27−`!wikipedia qwer <https://searx.me/?q=%21wikipedia%20qwer>`_
28−
29−Image search:
30−`!images Cthulhu <https://searx.me/?q=%21images%20Cthulhu>`_
31−
32−Custom language in wikipedia:
33−`:hu !wp hackerspace <https://searx.me/?q=%3Ahu%20%21wp%20hackerspace>`_
_static/ajax-loader.gifdeleted

Binary file not shown.

_static/basic.css+133−4
@@ -4,7 +4,7 @@
44 *
55 * Sphinx stylesheet -- basic theme.
66 *
7− * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
7+ * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
88 * :license: BSD, see LICENSE for details.
99 *
1010 */
@@ -81,10 +81,26 @@ div.sphinxsidebar input {
8181 font-size: 1em;
8282}
8383
84+div.sphinxsidebar #searchbox form.search {
85+ overflow: hidden;
86+}
87+
8488div.sphinxsidebar #searchbox input[type="text"] {
85− width: 170px;
89+ float: left;
90+ width: 80%;
91+ padding: 0.25em;
92+ box-sizing: border-box;
8693}
8794
95+div.sphinxsidebar #searchbox input[type="submit"] {
96+ float: left;
97+ width: 20%;
98+ border-left: none;
99+ padding: 0.25em;
100+ box-sizing: border-box;
101+}
102+
103+
88104img {
89105 border: 0;
90106 max-width: 100%;
@@ -199,6 +215,11 @@ table.modindextable td {
199215
200216/* -- general body styles --------------------------------------------------- */
201217
218+div.body {
219+ min-width: 450px;
220+ max-width: 800px;
221+}
222+
202223div.body p, div.body dd, div.body li, div.body blockquote {
203224 -moz-hyphens: auto;
204225 -ms-hyphens: auto;
@@ -210,6 +231,16 @@ a.headerlink {
210231 visibility: hidden;
211232}
212233
234+a.brackets:before,
235+span.brackets > a:before{
236+ content: "[";
237+}
238+
239+a.brackets:after,
240+span.brackets > a:after {
241+ content: "]";
242+}
243+
213244h1:hover > a.headerlink,
214245h2:hover > a.headerlink,
215246h3:hover > a.headerlink,
@@ -258,6 +289,12 @@ img.align-center, .figure.align-center, object.align-center {
258289 margin-right: auto;
259290}
260291
292+img.align-default, .figure.align-default {
293+ display: block;
294+ margin-left: auto;
295+ margin-right: auto;
296+}
297+
261298.align-left {
262299 text-align: left;
263300}
@@ -266,6 +303,10 @@ img.align-center, .figure.align-center, object.align-center {
266303 text-align: center;
267304}
268305
306+.align-default {
307+ text-align: center;
308+}
309+
269310.align-right {
270311 text-align: right;
271312}
@@ -332,6 +373,16 @@ table.docutils {
332373 border-collapse: collapse;
333374}
334375
376+table.align-center {
377+ margin-left: auto;
378+ margin-right: auto;
379+}
380+
381+table.align-default {
382+ margin-left: auto;
383+ margin-right: auto;
384+}
385+
335386table caption span.caption-number {
336387 font-style: italic;
337388}
@@ -365,6 +416,16 @@ table.citation td {
365416 border-bottom: none;
366417}
367418
419+th > p:first-child,
420+td > p:first-child {
421+ margin-top: 0px;
422+}
423+
424+th > p:last-child,
425+td > p:last-child {
426+ margin-bottom: 0px;
427+}
428+
368429/* -- figures --------------------------------------------------------------- */
369430
370431div.figure {
@@ -405,6 +466,13 @@ table.field-list td, table.field-list th {
405466 hyphens: manual;
406467}
407468
469+/* -- hlist styles ---------------------------------------------------------- */
470+
471+table.hlist td {
472+ vertical-align: top;
473+}
474+
475+
408476/* -- other body styles ----------------------------------------------------- */
409477
410478ol.arabic {
@@ -427,11 +495,58 @@ ol.upperroman {
427495 list-style: upper-roman;
428496}
429497
498+li > p:first-child {
499+ margin-top: 0px;
500+}
501+
502+li > p:last-child {
503+ margin-bottom: 0px;
504+}
505+
506+dl.footnote > dt,
507+dl.citation > dt {
508+ float: left;
509+}
510+
511+dl.footnote > dd,
512+dl.citation > dd {
513+ margin-bottom: 0em;
514+}
515+
516+dl.footnote > dd:after,
517+dl.citation > dd:after {
518+ content: "";
519+ clear: both;
520+}
521+
522+dl.field-list {
523+ display: grid;
524+ grid-template-columns: fit-content(30%) auto;
525+}
526+
527+dl.field-list > dt {
528+ font-weight: bold;
529+ word-break: break-word;
530+ padding-left: 0.5em;
531+ padding-right: 5px;
532+}
533+
534+dl.field-list > dt:after {
535+ content: ":";
536+}
537+
538+dl.field-list > dd {
539+ padding-left: 0.5em;
540+ margin-top: 0em;
541+ margin-left: 0em;
542+ margin-bottom: 0em;
543+}
544+
430545dl {
431546 margin-bottom: 15px;
432547}
433548
434−dd p {
549+dd > p:first-child {
435550 margin-top: 0px;
436551}
437552
@@ -445,10 +560,14 @@ dd {
445560 margin-left: 30px;
446561}
447562
448−dt:target, .highlighted {
563+dt:target, span.highlighted {
449564 background-color: #fbe54e;
450565}
451566
567+rect.highlighted {
568+ fill: #fbe54e;
569+}
570+
452571dl.glossary dt {
453572 font-weight: bold;
454573 font-size: 1.1em;
@@ -500,6 +619,12 @@ dl.glossary dt {
500619 font-style: oblique;
501620}
502621
622+.classifier:before {
623+ font-style: normal;
624+ margin: 0.5em;
625+ content: ":";
626+}
627+
503628abbr, acronym {
504629 border-bottom: dotted 1px;
505630 cursor: help;
@@ -547,6 +672,10 @@ div.code-block-caption + div > div.highlight > pre {
547672 margin-top: 0;
548673}
549674
675+div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
676+ user-select: none;
677+}
678+
550679div.code-block-caption span.caption-number {
551680 padding: 0.1em 0.3em;
552681 font-style: italic;
_static/comment-bright.pngdeleted

Binary file not shown.

_static/comment-close.pngdeleted

Binary file not shown.

_static/comment.pngdeleted

Binary file not shown.

_static/doctools.js+46−19
@@ -4,7 +4,7 @@
44 *
55 * Sphinx JavaScript utilities for all documentation.
66 *
7− * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
7+ * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
88 * :license: BSD, see LICENSE for details.
99 *
1010 */
@@ -45,7 +45,7 @@ jQuery.urlencode = encodeURIComponent;
4545 * it will always return arrays of strings for the value parts.
4646 */
4747jQuery.getQueryParameters = function(s) {
48− if (typeof s == 'undefined')
48+ if (typeof s === 'undefined')
4949 s = document.location.search;
5050 var parts = s.substr(s.indexOf('?') + 1).split('&');
5151 var result = {};
@@ -66,29 +66,54 @@ jQuery.getQueryParameters = function(s) {
6666 * span elements with the given class name.
6767 */
6868jQuery.fn.highlightText = function(text, className) {
69− function highlight(node) {
70− if (node.nodeType == 3) {
69+ function highlight(node, addItems) {
70+ if (node.nodeType === 3) {
7171 var val = node.nodeValue;
7272 var pos = val.toLowerCase().indexOf(text);
73− if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
74− var span = document.createElement("span");
75− span.className = className;
73+ if (pos >= 0 &&
74+ !jQuery(node.parentNode).hasClass(className) &&
75+ !jQuery(node.parentNode).hasClass("nohighlight")) {
76+ var span;
77+ var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
78+ if (isInSVG) {
79+ span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
80+ } else {
81+ span = document.createElement("span");
82+ span.className = className;
83+ }
7684 span.appendChild(document.createTextNode(val.substr(pos, text.length)));
7785 node.parentNode.insertBefore(span, node.parentNode.insertBefore(
7886 document.createTextNode(val.substr(pos + text.length)),
7987 node.nextSibling));
8088 node.nodeValue = val.substr(0, pos);
89+ if (isInSVG) {
90+ var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
91+ var bbox = node.parentElement.getBBox();
92+ rect.x.baseVal.value = bbox.x;
93+ rect.y.baseVal.value = bbox.y;
94+ rect.width.baseVal.value = bbox.width;
95+ rect.height.baseVal.value = bbox.height;
96+ rect.setAttribute('class', className);
97+ addItems.push({
98+ "parent": node.parentNode,
99+ "target": rect});
100+ }
81101 }
82102 }
83103 else if (!jQuery(node).is("button, select, textarea")) {
84104 jQuery.each(node.childNodes, function() {
85− highlight(this);
105+ highlight(this, addItems);
86106 });
87107 }
88108 }
89− return this.each(function() {
90− highlight(this);
109+ var addItems = [];
110+ var result = this.each(function() {
111+ highlight(this, addItems);
91112 });
113+ for (var i = 0; i < addItems.length; ++i) {
114+ jQuery(addItems[i].parent).before(addItems[i].target);
115+ }
116+ return result;
92117};
93118
94119/*
@@ -124,28 +149,30 @@ var Documentation = {
124149 this.fixFirefoxAnchorBug();
125150 this.highlightSearchWords();
126151 this.initIndexTable();
127−
152+ if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
153+ this.initOnKeyListeners();
154+ }
128155 },
129156
130157 /**
131158 * i18n support
132159 */
133160 TRANSLATIONS : {},
134− PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
161+ PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
135162 LOCALE : 'unknown',
136163
137164 // gettext and ngettext don't access this so that the functions
138165 // can safely bound to a different name (_ = Documentation.gettext)
139166 gettext : function(string) {
140167 var translated = Documentation.TRANSLATIONS[string];
141− if (typeof translated == 'undefined')
168+ if (typeof translated === 'undefined')
142169 return string;
143− return (typeof translated == 'string') ? translated : translated[0];
170+ return (typeof translated === 'string') ? translated : translated[0];
144171 },
145172
146173 ngettext : function(singular, plural, n) {
147174 var translated = Documentation.TRANSLATIONS[singular];
148− if (typeof translated == 'undefined')
175+ if (typeof translated === 'undefined')
149176 return (n == 1) ? singular : plural;
150177 return translated[Documentation.PLURALEXPR(n)];
151178 },
@@ -180,7 +207,7 @@ var Documentation = {
180207 * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
181208 */
182209 fixFirefoxAnchorBug : function() {
183− if (document.location.hash)
210+ if (document.location.hash && $.browser.mozilla)
184211 window.setTimeout(function() {
185212 document.location.href += '';
186213 }, 10);
@@ -216,7 +243,7 @@ var Documentation = {
216243 var src = $(this).attr('src');
217244 var idnum = $(this).attr('id').substr(7);
218245 $('tr.cg-' + idnum).toggle();
219− if (src.substr(-9) == 'minus.png')
246+ if (src.substr(-9) === 'minus.png')
220247 $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
221248 else
222249 $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
@@ -248,7 +275,7 @@ var Documentation = {
248275 var path = document.location.pathname;
249276 var parts = path.split(/\//);
250277 $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
251− if (this == '..')
278+ if (this === '..')
252279 parts.pop();
253280 });
254281 var url = parts.join('/');
@@ -284,4 +311,4 @@ _ = Documentation.gettext;
284311
285312$(document).ready(function() {
286313 Documentation.init();
287−});
314+});
_static/documentation_options.jsnew file+11
@@ -0,0 +1,11 @@
1+var DOCUMENTATION_OPTIONS = {
2+ URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
3+ VERSION: '0.15.0',
4+ LANGUAGE: 'None',
5+ COLLAPSE_INDEX: false,
6+ BUILDER: 'html',
7+ FILE_SUFFIX: '.html',
8+ HAS_SOURCE: true,
9+ SOURCELINK_SUFFIX: '.txt',
10+ NAVIGATION_WITH_KEYS: false
11+};
_static/down-pressed.pngdeleted

Binary file not shown.

_static/down.pngdeleted

Binary file not shown.

_static/jquery-1.11.1.js → _static/jquery-3.4.1.jsrenamed+5050−4760

This diff is too big to show here.

_static/jquery.js+2−4

This diff is too big to show here.

_static/language_data.jsnew file+297

This diff is too big to show here.

_static/pocoo.cssnew file+483

This diff is too big to show here.

_static/pygments.css+69−61

This diff is too big to show here.

_static/searchtools.js+76−328

This diff is too big to show here.

_static/searx.cssnew file+130

This diff is too big to show here.

docs/static/img/searx_logo_small.png → _static/searx_logo_small.pngrenamed

Binary file not shown.

_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.cssnew file+1

This diff is too big to show here.

_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.cssnew file+9

This diff is too big to show here.

_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.cssnew file+9

This diff is too big to show here.

_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.jsnew file+1

This diff is too big to show here.

_static/sphinx_tabs/tabs.cssnew file+44

This diff is too big to show here.

_static/sphinx_tabs/tabs.jsnew file+94

This diff is too big to show here.

_static/style.cssdeleted−443

This diff is too big to show here.

_static/up-pressed.pngdeleted

Binary file not shown.

_static/up.pngdeleted

Binary file not shown.

_static/version_warning_offset.jsnew file+40

This diff is too big to show here.

_static/websupport.jsdeleted−808

This diff is too big to show here.

admin/api.html+115−84

This diff is too big to show here.

admin/architecture.htmlnew file+119

This diff is too big to show here.

admin/buildhosts.htmlnew file+223

This diff is too big to show here.

admin/engines.htmlnew file+1441

This diff is too big to show here.

admin/filtron.html+181−116

This diff is too big to show here.

admin/index.htmlnew file+114

This diff is too big to show here.

admin/installation.htmlnew file+393

This diff is too big to show here.

admin/morty.html+83−48

This diff is too big to show here.

admin/plugins.htmlnew file+186

This diff is too big to show here.

blog/admin.html+95−56

This diff is too big to show here.

blog/blog.htmldeleted−80

This diff is too big to show here.

blog/index.htmlnew file+109

This diff is too big to show here.

blog/intro-offline.html+84−44

This diff is too big to show here.

blog/python3.html+101−57

This diff is too big to show here.

dev/contribution_guide.html+185−93

This diff is too big to show here.

dev/engine_overview.html+402−363

This diff is too big to show here.

dev/index.htmlnew file+114

This diff is too big to show here.

dev/install/installation.htmldeleted−351

This diff is too big to show here.

dev/makefile.htmlnew file+285

This diff is too big to show here.

dev/plugins.html+86−47

This diff is too big to show here.

dev/quickstart.html+136−85

This diff is too big to show here.

dev/reST.htmlnew file+1620

This diff is too big to show here.

dev/search_api.html+154−148

This diff is too big to show here.

dev/translation.html+97−62

This diff is too big to show here.

docs/_themes/searx_theme/layout.htmldeleted−20

This diff is too big to show here.

docs/_themes/searx_theme/relations.htmldeleted−14

This diff is too big to show here.

docs/_themes/searx_theme/static/style.css_tdeleted−443

This diff is too big to show here.

docs/_themes/searx_theme/theme.confdeleted−7

This diff is too big to show here.

docs/admin/api.rstdeleted−94

This diff is too big to show here.

docs/admin/filtron.rstdeleted−114

This diff is too big to show here.

docs/admin/morty.rstdeleted−21

This diff is too big to show here.

docs/blog/admin.rstdeleted−42

This diff is too big to show here.

docs/blog/intro-offline.rstdeleted−65

This diff is too big to show here.

docs/blog/python3.rstdeleted−54

This diff is too big to show here.

docs/blog/searx-admin-engines.pngdeleted

Binary file not shown.

docs/blog/searxpy3.pngdeleted

Binary file not shown.

docs/conf.pydeleted−358

This diff is too big to show here.

docs/dev/contribution_guide.rstdeleted−98

This diff is too big to show here.

docs/dev/engine_overview.rstdeleted−315

This diff is too big to show here.

docs/dev/plugins.rstdeleted−45

This diff is too big to show here.

docs/dev/quickstart.rstdeleted−108

This diff is too big to show here.

docs/dev/search_api.rstdeleted−204

This diff is too big to show here.

docs/dev/translation.rstdeleted−61

This diff is too big to show here.

docs/index.rstdeleted−56

This diff is too big to show here.

docs/user/own-instance.rstdeleted−43

This diff is too big to show here.

docs/user/search_syntax.rstdeleted−33

This diff is too big to show here.

genindex.html+87−38

This diff is too big to show here.

index.html+110−82

This diff is too big to show here.

objects.inv

Binary file not shown.

requirements.txtdeleted−1

This diff is too big to show here.

search.html+54−43

This diff is too big to show here.

searchindex.js+1−1

This diff is too big to show here.

user/index.htmlnew file+108

This diff is too big to show here.

user/own-instance.html+116−54

This diff is too big to show here.

user/search_syntax.html+98−58

This diff is too big to show here.