| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | # -*- coding: utf-8 -*- | 
					
						
							| 
									
										
										
										
											2021-04-17 18:20:29 +02:00
										 |  |  | # SPDX-License-Identifier: AGPL-3.0-or-later | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | import  sys, os | 
					
						
							|  |  |  | from pallets_sphinx_themes import ProjectLink | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-21 00:37:45 +01:00
										 |  |  | from searx import brand | 
					
						
							|  |  |  | from searx.version import VERSION_STRING | 
					
						
							| 
									
										
										
										
											2020-09-29 12:30:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | # Project -------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | project = u'searx' | 
					
						
							| 
									
										
										
										
											2020-02-20 18:11:34 +01:00
										 |  |  | copyright = u'2015-2020, Adam Tauber, Noémi Ványi' | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | author = u'Adam Tauber' | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | release, version = VERSION_STRING, VERSION_STRING | 
					
						
							| 
									
										
										
										
											2019-12-19 17:05:50 +01:00
										 |  |  | highlight_language = 'none' | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | # General -------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | master_doc = "index" | 
					
						
							|  |  |  | source_suffix = '.rst' | 
					
						
							| 
									
										
										
										
											2019-12-19 23:36:53 +01:00
										 |  |  | numfig = True | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-03 16:26:02 +01:00
										 |  |  | exclude_patterns = ['build-templates/*.rst'] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-21 09:53:41 +01:00
										 |  |  | import searx.search | 
					
						
							|  |  |  | import searx.engines | 
					
						
							|  |  |  | import searx.plugins | 
					
						
							|  |  |  | searx.search.initialize() | 
					
						
							| 
									
										
										
										
											2019-12-21 17:13:38 +01:00
										 |  |  | jinja_contexts = { | 
					
						
							| 
									
										
										
										
											2020-12-21 09:53:41 +01:00
										 |  |  |     'searx': { | 
					
						
							|  |  |  |         'engines': searx.engines.engines, | 
					
						
							|  |  |  |         'plugins': searx.plugins.plugins | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2019-12-21 17:13:38 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 16:48:36 +01:00
										 |  |  | # usage::   lorem :patch:`f373169` ipsum | 
					
						
							|  |  |  | extlinks = {} | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | # upstream links | 
					
						
							| 
									
										
										
										
											2021-04-25 12:03:54 +02:00
										 |  |  | extlinks['wiki'] = ('https://github.com/searxng/searxng/wiki/%s', ' ') | 
					
						
							|  |  |  | extlinks['pull'] = ('https://github.com/searxng/searxng/pull/%s', 'PR ') | 
					
						
							|  |  |  | extlinks['pull-searx'] = ('https://github.com/searx/searx/pull/%s', 'PR ') | 
					
						
							| 
									
										
										
										
											2019-12-12 19:20:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | # links to custom brand | 
					
						
							| 
									
										
										
										
											2020-12-21 00:37:45 +01:00
										 |  |  | extlinks['origin'] = (brand.GIT_URL + '/blob/' + brand.GIT_BRANCH + '/%s', 'git://') | 
					
						
							|  |  |  | extlinks['patch'] = (brand.GIT_URL + '/commit/%s', '#') | 
					
						
							|  |  |  | extlinks['search'] = (brand.SEARX_URL + '/%s', '#') | 
					
						
							|  |  |  | extlinks['docs'] = (brand.DOCS_URL + '/%s', 'docs: ') | 
					
						
							| 
									
										
										
										
											2019-12-18 16:11:05 +01:00
										 |  |  | extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ') | 
					
						
							| 
									
										
										
										
											2019-12-18 18:32:42 +01:00
										 |  |  | extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '') | 
					
						
							| 
									
										
										
										
											2019-12-19 23:36:53 +01:00
										 |  |  | #extlinks['role'] = ( | 
					
						
							|  |  |  | #    'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '') | 
					
						
							| 
									
										
										
										
											2019-12-19 17:05:50 +01:00
										 |  |  | extlinks['duref'] = ( | 
					
						
							| 
									
										
										
										
											2020-12-04 16:50:26 +01:00
										 |  |  |     'https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '') | 
					
						
							| 
									
										
										
										
											2019-12-19 17:05:50 +01:00
										 |  |  | extlinks['durole'] = ( | 
					
						
							| 
									
										
										
										
											2020-12-04 16:50:26 +01:00
										 |  |  |     'https://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '') | 
					
						
							| 
									
										
										
										
											2019-12-19 17:05:50 +01:00
										 |  |  | extlinks['dudir'] =  ( | 
					
						
							| 
									
										
										
										
											2020-12-04 16:50:26 +01:00
										 |  |  |     'https://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '') | 
					
						
							| 
									
										
										
										
											2019-12-28 01:01:11 +01:00
										 |  |  | extlinks['ctan'] =  ( | 
					
						
							|  |  |  |     'https://ctan.org/pkg/%s', 'CTAN: ') | 
					
						
							| 
									
										
										
										
											2019-12-04 16:48:36 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | extensions = [ | 
					
						
							| 
									
										
										
										
											2019-12-28 01:25:16 +01:00
										 |  |  |     'sphinx.ext.imgmath', | 
					
						
							| 
									
										
										
										
											2019-12-04 16:48:36 +01:00
										 |  |  |     'sphinx.ext.extlinks', | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  |     'sphinx.ext.viewcode', | 
					
						
							|  |  |  |     "sphinx.ext.autodoc", | 
					
						
							|  |  |  |     "sphinx.ext.intersphinx", | 
					
						
							|  |  |  |     "pallets_sphinx_themes", | 
					
						
							|  |  |  |     "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst | 
					
						
							| 
									
										
										
										
											2019-12-21 17:13:38 +01:00
										 |  |  |     "sphinxcontrib.jinja",  # https://github.com/tardyp/sphinx-jinja | 
					
						
							| 
									
										
										
										
											2020-01-11 12:49:02 +01:00
										 |  |  |     "sphinxcontrib.programoutput",  # https://github.com/NextThought/sphinxcontrib-programoutput | 
					
						
							| 
									
										
										
										
											2020-06-18 18:51:31 +02:00
										 |  |  |     'linuxdoc.kernel_include',  # Implementation of the 'kernel-include' reST-directive. | 
					
						
							| 
									
										
										
										
											2019-12-19 23:36:53 +01:00
										 |  |  |     'linuxdoc.rstFlatTable',    # Implementation of the 'flat-table' reST-directive. | 
					
						
							|  |  |  |     'linuxdoc.kfigure',         # Sphinx extension which implements scalable image handling. | 
					
						
							| 
									
										
										
										
											2019-12-26 10:26:12 +01:00
										 |  |  |     "sphinx_tabs.tabs", # https://github.com/djungelorm/sphinx-tabs | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | ] | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | intersphinx_mapping = { | 
					
						
							|  |  |  |     "python": ("https://docs.python.org/3/", None), | 
					
						
							| 
									
										
										
										
											2019-12-19 17:05:50 +01:00
										 |  |  |     "flask": ("https://flask.palletsprojects.com/", None), | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  |     # "werkzeug": ("https://werkzeug.palletsprojects.com/", None), | 
					
						
							| 
									
										
										
										
											2019-12-19 17:05:50 +01:00
										 |  |  |     "jinja": ("https://jinja.palletsprojects.com/", None), | 
					
						
							| 
									
										
										
										
											2019-12-19 23:36:53 +01:00
										 |  |  |     "linuxdoc" : ("https://return42.github.io/linuxdoc/", None), | 
					
						
							|  |  |  |     "sphinx" : ("https://www.sphinx-doc.org/en/master/", None), | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-25 12:03:54 +02:00
										 |  |  | issues_github_path = "searxng/searxng" | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | # HTML ----------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | sys.path.append(os.path.abspath('_themes')) | 
					
						
							| 
									
										
										
										
											2020-11-04 13:38:54 +01:00
										 |  |  | sys.path.insert(0, os.path.abspath("../utils/")) | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | html_theme_path = ['_themes'] | 
					
						
							|  |  |  | html_theme = "searx" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-28 01:25:16 +01:00
										 |  |  | # sphinx.ext.imgmath setup | 
					
						
							|  |  |  | html_math_renderer = 'imgmath' | 
					
						
							|  |  |  | imgmath_image_format = 'svg' | 
					
						
							|  |  |  | imgmath_font_size = 14 | 
					
						
							|  |  |  | # sphinx.ext.imgmath setup END | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | html_theme_options = {"index_sidebar_logo": True} | 
					
						
							| 
									
										
										
										
											2020-12-21 00:37:45 +01:00
										 |  |  | html_context = {"project_links": [] } | 
					
						
							|  |  |  | if brand.GIT_URL: | 
					
						
							|  |  |  |     html_context["project_links"].append(ProjectLink("Source", brand.GIT_URL)) | 
					
						
							|  |  |  | if brand.WIKI_URL: | 
					
						
							|  |  |  |     html_context["project_links"].append(ProjectLink("Wiki", brand.WIKI_URL)) | 
					
						
							|  |  |  | if brand.PUBLIC_INSTANCES: | 
					
						
							|  |  |  |     html_context["project_links"].append(ProjectLink("Public instances", brand.PUBLIC_INSTANCES)) | 
					
						
							|  |  |  | if brand.TWITTER_URL: | 
					
						
							|  |  |  |     html_context["project_links"].append(ProjectLink("Twitter", brand.TWITTER_URL)) | 
					
						
							|  |  |  | if brand.ISSUE_URL: | 
					
						
							|  |  |  |     html_context["project_links"].append(ProjectLink("Issue Tracker", brand.ISSUE_URL)) | 
					
						
							|  |  |  | if brand.CONTACT_URL: | 
					
						
							|  |  |  |     html_context["project_links"].append(ProjectLink("Contact", brand.CONTACT_URL)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | html_sidebars = { | 
					
						
							|  |  |  |     "**": ["project.html", "relations.html", "searchbox.html"], | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]} | 
					
						
							|  |  |  | html_static_path = ["static"] | 
					
						
							|  |  |  | html_logo = "static/img/searx_logo_small.png" | 
					
						
							|  |  |  | html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING)) | 
					
						
							|  |  |  | html_show_sourcelink = False | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | # LaTeX ---------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 15:27:27 +01:00
										 |  |  | latex_documents = [ | 
					
						
							|  |  |  |     (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual") | 
					
						
							| 
									
										
										
										
											2015-11-17 23:13:30 +01:00
										 |  |  | ] |