2015-11-17 22:13:30 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
import sys, os
|
2020-03-21 17:45:38 +00:00
|
|
|
from sphinx_build_tools import load_sphinx_config
|
2019-12-04 14:27:27 +00:00
|
|
|
from searx.version import VERSION_STRING
|
|
|
|
from pallets_sphinx_themes import ProjectLink
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2020-03-29 13:09:34 +00:00
|
|
|
from searx.brand import GIT_URL
|
2020-03-29 14:28:17 +00:00
|
|
|
GIT_BRANCH = os.environ.get("GIT_BRANCH", "master")
|
2020-03-29 13:09:34 +00:00
|
|
|
from searx.brand import SEARX_URL
|
|
|
|
from searx.brand import DOCS_URL
|
2019-12-04 15:48:36 +00:00
|
|
|
|
2020-09-29 10:30:10 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
# Project --------------------------------------------------------------
|
2015-11-17 22:13:30 +00:00
|
|
|
|
|
|
|
project = u'searx'
|
2020-02-20 17:11:34 +00:00
|
|
|
copyright = u'2015-2020, Adam Tauber, Noémi Ványi'
|
2015-11-17 22:13:30 +00:00
|
|
|
author = u'Adam Tauber'
|
2019-12-04 14:27:27 +00:00
|
|
|
release, version = VERSION_STRING, VERSION_STRING
|
2019-12-19 16:05:50 +00:00
|
|
|
highlight_language = 'none'
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
# General --------------------------------------------------------------
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
master_doc = "index"
|
|
|
|
source_suffix = '.rst'
|
2019-12-19 22:36:53 +00:00
|
|
|
numfig = True
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2020-03-03 15:26:02 +00:00
|
|
|
exclude_patterns = ['build-templates/*.rst']
|
|
|
|
|
2019-12-21 16:13:38 +00:00
|
|
|
from searx import webapp
|
|
|
|
jinja_contexts = {
|
2020-09-29 10:30:10 +00:00
|
|
|
'webapp': dict(**webapp.__dict__),
|
2019-12-21 16:13:38 +00:00
|
|
|
}
|
|
|
|
|
2019-12-04 15:48:36 +00:00
|
|
|
# usage:: lorem :patch:`f373169` ipsum
|
|
|
|
extlinks = {}
|
2019-12-12 18:20:56 +00:00
|
|
|
|
|
|
|
# upstream links
|
2020-09-28 14:44:14 +00:00
|
|
|
extlinks['wiki'] = ('https://github.com/searx/searx/wiki/%s', ' ')
|
|
|
|
extlinks['pull'] = ('https://github.com/searx/searx/pull/%s', 'PR ')
|
2019-12-12 18:20:56 +00:00
|
|
|
|
|
|
|
# links to custom brand
|
2020-02-04 12:26:43 +00:00
|
|
|
extlinks['origin'] = (GIT_URL + '/blob/' + GIT_BRANCH + '/%s', 'git://')
|
2019-12-04 15:48:36 +00:00
|
|
|
extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
|
|
|
|
extlinks['search'] = (SEARX_URL + '/%s', '#')
|
2019-12-13 13:57:07 +00:00
|
|
|
extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
|
2019-12-18 15:11:05 +00:00
|
|
|
extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
|
2019-12-18 17:32:42 +00:00
|
|
|
extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
|
2019-12-19 22:36:53 +00:00
|
|
|
#extlinks['role'] = (
|
|
|
|
# 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '')
|
2019-12-19 16:05:50 +00:00
|
|
|
extlinks['duref'] = (
|
|
|
|
'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '')
|
|
|
|
extlinks['durole'] = (
|
|
|
|
'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '')
|
|
|
|
extlinks['dudir'] = (
|
|
|
|
'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '')
|
2019-12-28 00:01:11 +00:00
|
|
|
extlinks['ctan'] = (
|
|
|
|
'https://ctan.org/pkg/%s', 'CTAN: ')
|
2019-12-04 15:48:36 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
extensions = [
|
2019-12-28 00:25:16 +00:00
|
|
|
'sphinx.ext.imgmath',
|
2019-12-04 15:48:36 +00:00
|
|
|
'sphinx.ext.extlinks',
|
2019-12-04 14:27:27 +00: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 16:13:38 +00:00
|
|
|
"sphinxcontrib.jinja", # https://github.com/tardyp/sphinx-jinja
|
2020-01-11 11:49:02 +00:00
|
|
|
"sphinxcontrib.programoutput", # https://github.com/NextThought/sphinxcontrib-programoutput
|
2020-06-18 16:51:31 +00:00
|
|
|
'linuxdoc.kernel_include', # Implementation of the 'kernel-include' reST-directive.
|
2019-12-19 22:36:53 +00:00
|
|
|
'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive.
|
|
|
|
'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling.
|
2019-12-26 09:26:12 +00:00
|
|
|
"sphinx_tabs.tabs", # https://github.com/djungelorm/sphinx-tabs
|
2019-12-04 14:27:27 +00:00
|
|
|
]
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
intersphinx_mapping = {
|
|
|
|
"python": ("https://docs.python.org/3/", None),
|
2019-12-19 16:05:50 +00:00
|
|
|
"flask": ("https://flask.palletsprojects.com/", None),
|
2019-12-04 14:27:27 +00:00
|
|
|
# "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
|
2019-12-19 16:05:50 +00:00
|
|
|
"jinja": ("https://jinja.palletsprojects.com/", None),
|
2019-12-19 22:36:53 +00:00
|
|
|
"linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
|
|
|
|
"sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
|
2019-12-04 14:27:27 +00:00
|
|
|
}
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2020-09-28 14:44:14 +00:00
|
|
|
issues_github_path = "searx/searx"
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
# HTML -----------------------------------------------------------------
|
2015-11-17 22:13:30 +00:00
|
|
|
|
|
|
|
sys.path.append(os.path.abspath('_themes'))
|
2020-11-04 12:38:54 +00:00
|
|
|
sys.path.insert(0, os.path.abspath("../utils/"))
|
2019-12-04 14:27:27 +00:00
|
|
|
html_theme_path = ['_themes']
|
|
|
|
html_theme = "searx"
|
|
|
|
|
2019-12-28 00:25:16 +00: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 14:27:27 +00:00
|
|
|
html_theme_options = {"index_sidebar_logo": True}
|
|
|
|
html_context = {
|
|
|
|
"project_links": [
|
2019-12-04 15:48:36 +00:00
|
|
|
ProjectLink("Source", GIT_URL),
|
2020-09-28 14:44:14 +00:00
|
|
|
ProjectLink("Wiki", "https://github.com/searx/searx/wiki"),
|
2020-02-14 12:45:50 +00:00
|
|
|
ProjectLink("Public instances", "https://searx.space/"),
|
2019-12-04 14:27:27 +00:00
|
|
|
ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
|
|
|
|
]
|
2015-11-17 22:13:30 +00:00
|
|
|
}
|
2019-12-04 14:27:27 +00: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 22:13:30 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
# LaTeX ----------------------------------------------------------------
|
2015-11-17 22:13:30 +00:00
|
|
|
|
2019-12-04 14:27:27 +00:00
|
|
|
latex_documents = [
|
|
|
|
(master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
|
2015-11-17 22:13:30 +00:00
|
|
|
]
|
2020-03-21 17:45:38 +00:00
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Since loadConfig overwrites settings from the global namespace, it has to be
|
|
|
|
# the last statement in the conf.py file
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
load_sphinx_config(globals())
|