on e30dc2f help sign in
searx/docs/conf.py
127 lines 4.6 kB history raw
1# -*- coding: utf-8 -*-
3import sys, os
4from sphinx_build_tools import load_sphinx_config
5from searx.version import VERSION_STRING
6from pallets_sphinx_themes import ProjectLink
8from searx.brand import GIT_URL
9GIT_BRANCH = os.environ.get("GIT_BRANCH", "master")
10from searx.brand import SEARX_URL
11from searx.brand import DOCS_URL
14# Project --------------------------------------------------------------
16project = u'searx'
17copyright = u'2015-2020, Adam Tauber, Noémi Ványi'
18author = u'Adam Tauber'
19release, version = VERSION_STRING, VERSION_STRING
20highlight_language = 'none'
22# General --------------------------------------------------------------
24master_doc = "index"
25source_suffix = '.rst'
26numfig = True
28exclude_patterns = ['build-templates/*.rst']
30from searx import webapp
31jinja_contexts = {
32 'webapp': dict(**webapp.__dict__),
35# usage:: lorem :patch:`f373169` ipsum
36extlinks = {}
38# upstream links
39extlinks['wiki'] = ('https://github.com/searx/searx/wiki/%s', ' ')
40extlinks['pull'] = ('https://github.com/searx/searx/pull/%s', 'PR ')
42# links to custom brand
43extlinks['origin'] = (GIT_URL + '/blob/' + GIT_BRANCH + '/%s', 'git://')
44extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
45extlinks['search'] = (SEARX_URL + '/%s', '#')
46extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
47extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
48extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
49#extlinks['role'] = (
50# 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '')
51extlinks['duref'] = (
52 'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '')
53extlinks['durole'] = (
54 'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '')
55extlinks['dudir'] = (
56 'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '')
57extlinks['ctan'] = (
58 'https://ctan.org/pkg/%s', 'CTAN: ')
60extensions = [
61 'sphinx.ext.imgmath',
62 'sphinx.ext.extlinks',
63 'sphinx.ext.viewcode',
64 "sphinx.ext.autodoc",
65 "sphinx.ext.intersphinx",
66 "pallets_sphinx_themes",
67 "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
68 "sphinxcontrib.jinja", # https://github.com/tardyp/sphinx-jinja
69 "sphinxcontrib.programoutput", # https://github.com/NextThought/sphinxcontrib-programoutput
70 'linuxdoc.kernel_include', # Implementation of the 'kernel-include' reST-directive.
71 'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive.
72 'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling.
73 "sphinx_tabs.tabs", # https://github.com/djungelorm/sphinx-tabs
76intersphinx_mapping = {
77 "python": ("https://docs.python.org/3/", None),
78 "flask": ("https://flask.palletsprojects.com/", None),
79 # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
80 "jinja": ("https://jinja.palletsprojects.com/", None),
81 "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
82 "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
85issues_github_path = "searx/searx"
87# HTML -----------------------------------------------------------------
89sys.path.append(os.path.abspath('_themes'))
90html_theme_path = ['_themes']
91html_theme = "searx"
93# sphinx.ext.imgmath setup
94html_math_renderer = 'imgmath'
95imgmath_image_format = 'svg'
96imgmath_font_size = 14
97# sphinx.ext.imgmath setup END
99html_theme_options = {"index_sidebar_logo": True}
100html_context = {
101 "project_links": [
102 ProjectLink("Source", GIT_URL),
103 ProjectLink("Wiki", "https://github.com/searx/searx/wiki"),
104 ProjectLink("Public instances", "https://searx.space/"),
105 ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
106 ]
108html_sidebars = {
109 "**": ["project.html", "relations.html", "searchbox.html"],
111singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
112html_static_path = ["static"]
113html_logo = "static/img/searx_logo_small.png"
114html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
115html_show_sourcelink = False
117# LaTeX ----------------------------------------------------------------
119latex_documents = [
120 (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
123# ------------------------------------------------------------------------------
124# Since loadConfig overwrites settings from the global namespace, it has to be
125# the last statement in the conf.py file
126# ------------------------------------------------------------------------------
127load_sphinx_config(globals())