on 2006eb4 help sign in
searx/docs/conf.py
130 lines 4.7 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
31import searx.engines
32searx.engines.initialize_engines(searx.settings['engines'])
33jinja_contexts = {
34 'webapp': dict(**webapp.__dict__),
35 'engines': searx.engines.engines
38# usage:: lorem :patch:`f373169` ipsum
39extlinks = {}
41# upstream links
42extlinks['wiki'] = ('https://github.com/searx/searx/wiki/%s', ' ')
43extlinks['pull'] = ('https://github.com/searx/searx/pull/%s', 'PR ')
45# links to custom brand
46extlinks['origin'] = (GIT_URL + '/blob/' + GIT_BRANCH + '/%s', 'git://')
47extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
48extlinks['search'] = (SEARX_URL + '/%s', '#')
49extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
50extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
51extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
52#extlinks['role'] = (
53# 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '')
54extlinks['duref'] = (
55 'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '')
56extlinks['durole'] = (
57 'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '')
58extlinks['dudir'] = (
59 'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '')
60extlinks['ctan'] = (
61 'https://ctan.org/pkg/%s', 'CTAN: ')
63extensions = [
64 'sphinx.ext.imgmath',
65 'sphinx.ext.extlinks',
66 'sphinx.ext.viewcode',
67 "sphinx.ext.autodoc",
68 "sphinx.ext.intersphinx",
69 "pallets_sphinx_themes",
70 "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
71 "sphinxcontrib.jinja", # https://github.com/tardyp/sphinx-jinja
72 "sphinxcontrib.programoutput", # https://github.com/NextThought/sphinxcontrib-programoutput
73 'linuxdoc.kernel_include', # Implementation of the 'kernel-include' reST-directive.
74 'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive.
75 'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling.
76 "sphinx_tabs.tabs", # https://github.com/djungelorm/sphinx-tabs
79intersphinx_mapping = {
80 "python": ("https://docs.python.org/3/", None),
81 "flask": ("https://flask.palletsprojects.com/", None),
82 # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
83 "jinja": ("https://jinja.palletsprojects.com/", None),
84 "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
85 "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
88issues_github_path = "searx/searx"
90# HTML -----------------------------------------------------------------
92sys.path.append(os.path.abspath('_themes'))
93html_theme_path = ['_themes']
94html_theme = "searx"
96# sphinx.ext.imgmath setup
97html_math_renderer = 'imgmath'
98imgmath_image_format = 'svg'
99imgmath_font_size = 14
100# sphinx.ext.imgmath setup END
102html_theme_options = {"index_sidebar_logo": True}
103html_context = {
104 "project_links": [
105 ProjectLink("Source", GIT_URL),
106 ProjectLink("Wiki", "https://github.com/searx/searx/wiki"),
107 ProjectLink("Public instances", "https://searx.space/"),
108 ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
109 ]
111html_sidebars = {
112 "**": ["project.html", "relations.html", "searchbox.html"],
114singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
115html_static_path = ["static"]
116html_logo = "static/img/searx_logo_small.png"
117html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
118html_show_sourcelink = False
120# LaTeX ----------------------------------------------------------------
122latex_documents = [
123 (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
126# ------------------------------------------------------------------------------
127# Since loadConfig overwrites settings from the global namespace, it has to be
128# the last statement in the conf.py file
129# ------------------------------------------------------------------------------
130load_sphinx_config(globals())