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