on master help sign in
doc: make use of sphinx.ext.extlinks & sphinx.ext.intersphinx

- add sphinx extensions - patch documentation to make use of These modules help to simplify the reST markup of external references. BTW it helps to write more readable reST and form custom brands. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commitaf2cae6d1d71859e867a9fbc5da604ef6a898794 authorMarkus Heiser <markus.heiser@darmarit.de> dateWed 4 Dec 2019, 16:48 (7 years ago) parent25fa7da
6 files changed+43−25
Makefile+3 docs/blog/intro-offline.rst+1−1 docs/conf.py+13−1 docs/dev/engine_overview.rst+6−7 docs/index.rst+1−2 docs/user/search_syntax.rst+19−14
Makefile+3
@@ -1,5 +1,8 @@
11# -*- coding: utf-8; mode: makefile-gmake -*-
22
3+export GIT_URL=https://github.com/asciimoo/searx
4+export SEARX_URL=https://searx.me
5+
36PYOBJECTS = searx
47DOC = docs
58PY_SETUP_EXTRAS ?= \[test\]
docs/blog/intro-offline.rst+1−1
@@ -40,7 +40,7 @@ Example skeleton for the new engines:
4040Development progress
4141--------------------
4242
43−First, a proposal has been created as a Github issue. Then it was moved to the wiki as a design document. You can read it here: https://github.com/asciimoo/searx/wiki/Offline-engines
43+First, a proposal has been created as a Github issue. Then it was moved to the wiki as a design document. You can read it here: :wiki:`Offline-engines`.
4444
4545In this development step, searx core was prepared to accept and perform offline searches. Offline search requests are scheduled together with regular offline requests.
4646
docs/conf.py+13−1
@@ -4,6 +4,9 @@ import sys, os
44from searx.version import VERSION_STRING
55from pallets_sphinx_themes import ProjectLink
66
7+GIT_URL = os.environ.get("GIT_URL", "https://github.com/asciimoo/searx")
8+SEARX_URL = os.environ.get("SEARX_URL", "https://searx.me")
9+
710# Project --------------------------------------------------------------
811
912project = u'searx'
@@ -16,7 +19,16 @@ release, version = VERSION_STRING, VERSION_STRING
1619master_doc = "index"
1720source_suffix = '.rst'
1821
22+# usage:: lorem :patch:`f373169` ipsum
23+
24+extlinks = {}
25+extlinks['origin'] = (GIT_URL + '/blob/master/%s', 'git://')
26+extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
27+extlinks['search'] = (SEARX_URL + '/%s', '#')
28+extlinks['wiki'] = ('https://github.com/asciimoo/searx/wiki/%s', ' ')
29+
1930extensions = [
31+ 'sphinx.ext.extlinks',
2032 'sphinx.ext.viewcode',
2133 "sphinx.ext.autodoc",
2234 "sphinx.ext.intersphinx",
@@ -43,7 +55,7 @@ html_theme = "searx"
4355html_theme_options = {"index_sidebar_logo": True}
4456html_context = {
4557 "project_links": [
46− ProjectLink("Source", os.environ.get("GIT_URL", "https://github.com/asciimoo")),
58+ ProjectLink("Source", GIT_URL),
4759 ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
4860 ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
4961 ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
docs/dev/engine_overview.rst+6−7
@@ -8,8 +8,7 @@ so it uses different search engines to provide better results.
88Because there is no general search API which could be used for every
99search engine, an adapter has to be built between searx and the
1010external search engines. Adapters are stored under the folder
11−`searx/engines
12−<https://github.com/asciimoo/searx/tree/master/searx/engines>`__.
11+:origin:`searx/engines`.
1312
1413
1514.. contents::
@@ -199,7 +198,7 @@ default
199198+--------------------+---------------------------------------------------------------------------------------------------------------+
200199| content | string, general result-text |
201200+--------------------+---------------------------------------------------------------------------------------------------------------+
202−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish |
201+| publishedDate | :py:class:`datetime.datetime`, time of publish |
203202+--------------------+---------------------------------------------------------------------------------------------------------------+
204203
205204images
@@ -218,7 +217,7 @@ to use this template, the parameter
218217+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
219218| content | *(partly implemented)* |
220219+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
221−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish *(partly implemented)* |
220+| publishedDate | :py:class:`datetime.datetime`, time of publish *(partly implemented)* |
222221+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
223222| img\_src | string, url to the result image |
224223+--------------------+---------------------------------------------------------------------------------------------------------------------------------------+
@@ -239,7 +238,7 @@ videos
239238+--------------------+--------------------------------------------------------------------------------------------------------------+
240239| content | *(not implemented yet)* |
241240+--------------------+--------------------------------------------------------------------------------------------------------------+
242−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish |
241+| publishedDate | :py:class:`datetime.datetime`, time of publish |
243242+--------------------+--------------------------------------------------------------------------------------------------------------+
244243| thumbnail | string, url to a small-preview image |
245244+--------------------+--------------------------------------------------------------------------------------------------------------+
@@ -258,7 +257,7 @@ torrent
258257+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
259258| content | string, general result-text |
260259+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
261−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish *(not implemented yet)* |
260+| publishedDate | :py:class:`datetime.datetime`, time of publish *(not implemented yet)* |
262261+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
263262| seed | int, number of seeder |
264263+------------------+---------------------------------------------------------------------------------------------------------------------------------------+
@@ -286,7 +285,7 @@ map
286285+-------------------------+--------------------------------------------------------------------------------------------------------------+
287286| content | string, general result-text |
288287+-------------------------+--------------------------------------------------------------------------------------------------------------+
289−| publishedDate | `datetime.datetime <https://docs.python.org/2/library/datetime.html#datetime-objects>`__, time of publish |
288+| publishedDate | :py:class:`datetime.datetime`, time of publish |
290289+-------------------------+--------------------------------------------------------------------------------------------------------------+
291290| latitude | latitude of result (in decimal format) |
292291+-------------------------+--------------------------------------------------------------------------------------------------------------+
docs/index.rst+1−2
@@ -5,9 +5,8 @@ Search without being tracked.
55
66Searx 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.
77
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`.
8+Get started with searx by using one of the :wiki:`Searx-instances`. If you don't trust anyone, you can set up your own, see :ref:`installation`.
99
10−.. _public instances: https://github.com/asciimoo/searx/wiki/Searx-instances
1110
1211Features
1312--------
docs/user/search_syntax.rst+19−14
@@ -4,30 +4,35 @@ Search syntax
44Searx allows you to modify the default categories, engines and search
55language via the search query.
66
7−Category/engine prefix: ``!``
7+Prefix ``!``
8+ to set Category/engine
89
9−Language prefix: ``:``
10+Prefix: ``:``
11+ to set language
1012
11−Prefix to add engines and categories to the currently selected
12−categories: ``?``
13+Prefix: ``?``
14+ to add engines and categories to the currently selected categories
1315
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``).
16+Abbrevations of the engines and languages are also accepted. Engine/category
17+modifiers are chainable and inclusive (e.g. with :search:`!it !ddg !wp qwer
18+<?q=%21it%20%21ddg%20%21wp%20qwer>` search in IT category **and** duckduckgo
19+**and** wikipedia for ``qwer``).
1820
19−See the `/preferences page <https://searx.me/preferences>`_ for the
20−list of engines, categories and languages.
21+See the :search:`/preferences page <preferences>` for the list of engines,
22+categories and languages.
2123
2224Examples
2325~~~~~~~~
2426
2527Search 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+- :search:`!wp qwer <?q=%21wp%20qwer>` or
30+- :search:`!wikipedia qwer :search:<?q=%21wikipedia%20qwer>`
2831
2932Image search:
30−`!images Cthulhu <https://searx.me/?q=%21images%20Cthulhu>`_
33+
34+- :search:`!images Cthulhu <?q=%21images%20Cthulhu>`
3135
3236Custom language in wikipedia:
33−`:hu !wp hackerspace <https://searx.me/?q=%3Ahu%20%21wp%20hackerspace>`_
37+
38+- :search:`:hu !wp hackerspace <?q=%3Ahu%20%21wp%20hackerspace>`