on 07c8ca8 help sign in
searx/docs/conf.py
105 lines 3.8 kB history raw
1# -*- coding: utf-8 -*-
3import sys, os
4from searx.version import VERSION_STRING
5from pallets_sphinx_themes import ProjectLink
7GIT_URL = os.environ.get("GIT_URL", "https://github.com/asciimoo/searx")
8SEARX_URL = os.environ.get("SEARX_URL", "https://searx.me")
9DOCS_URL = os.environ.get("DOCS_URL", "https://asciimoo.github.io/searx/")
11# Project --------------------------------------------------------------
13project = u'searx'
14copyright = u'2015-2019, Adam Tauber, Noémi Ványi'
15author = u'Adam Tauber'
16release, version = VERSION_STRING, VERSION_STRING
17highlight_language = 'none'
19# General --------------------------------------------------------------
21master_doc = "index"
22source_suffix = '.rst'
23numfig = True
25from searx import webapp
26jinja_contexts = {
27 'webapp': dict(**webapp.__dict__)
30# usage:: lorem :patch:`f373169` ipsum
31extlinks = {}
33# upstream links
34extlinks['wiki'] = ('https://github.com/asciimoo/searx/wiki/%s', ' ')
35extlinks['pull'] = ('https://github.com/asciimoo/searx/pull/%s', 'PR ')
37# links to custom brand
38extlinks['origin'] = (GIT_URL + '/blob/master/%s', 'git://')
39extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
40extlinks['search'] = (SEARX_URL + '/%s', '#')
41extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
42extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
43extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
44#extlinks['role'] = (
45# 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '')
46extlinks['duref'] = (
47 'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '')
48extlinks['durole'] = (
49 'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '')
50extlinks['dudir'] = (
51 'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '')
53extensions = [
54 'sphinx.ext.extlinks',
55 'sphinx.ext.viewcode',
56 "sphinx.ext.autodoc",
57 "sphinx.ext.intersphinx",
58 "pallets_sphinx_themes",
59 "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
60 "sphinxcontrib.jinja", # https://github.com/tardyp/sphinx-jinja
61 'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive.
62 'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling.
65intersphinx_mapping = {
66 "python": ("https://docs.python.org/3/", None),
67 "flask": ("https://flask.palletsprojects.com/", None),
68 # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
69 "jinja": ("https://jinja.palletsprojects.com/", None),
70 "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
71 "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
74issues_github_path = "asciimoo/searx"
76# HTML -----------------------------------------------------------------
78sys.path.append(os.path.abspath('_themes'))
80html_theme_path = ['_themes']
81html_theme = "searx"
83html_theme_options = {"index_sidebar_logo": True}
84html_context = {
85 "project_links": [
86 ProjectLink("Source", GIT_URL),
87 ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
88 ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
89 ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
90 ]
92html_sidebars = {
93 "**": ["project.html", "relations.html", "searchbox.html"],
95singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
96html_static_path = ["static"]
97html_logo = "static/img/searx_logo_small.png"
98html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
99html_show_sourcelink = False
101# LaTeX ----------------------------------------------------------------
103latex_documents = [
104 (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")