diff options
Diffstat (limited to 'docs/conf.py')
-rw-r--r-- | docs/conf.py | 75 |
1 files changed, 46 insertions, 29 deletions
diff --git a/docs/conf.py b/docs/conf.py index af255e2..6efd762 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- +# SPDX-License-Identifier: AGPL-3.0-or-later import sys, os -from searx.version import VERSION_STRING from pallets_sphinx_themes import ProjectLink -GIT_URL = os.environ.get("GIT_URL", "https://github.com/asciimoo/searx") -SEARX_URL = os.environ.get("SEARX_URL", "https://searx.me") -DOCS_URL = os.environ.get("DOCS_URL", "https://asciimoo.github.io/searx/") +from searx import brand +from searx.version import VERSION_STRING # Project -------------------------------------------------------------- project = u'searx' -copyright = u'2015-2019, Adam Tauber, Noémi Ványi' +copyright = u'2015-2021, Adam Tauber, Noémi Ványi' author = u'Adam Tauber' release, version = VERSION_STRING, VERSION_STRING highlight_language = 'none' @@ -22,35 +21,43 @@ master_doc = "index" source_suffix = '.rst' numfig = True -from searx import webapp +exclude_patterns = ['build-templates/*.rst'] + +import searx.search +import searx.engines +import searx.plugins +searx.search.initialize() jinja_contexts = { - 'webapp': dict(**webapp.__dict__) + 'searx': { + 'engines': searx.engines.engines, + 'plugins': searx.plugins.plugins + }, } # usage:: lorem :patch:`f373169` ipsum extlinks = {} # upstream links -extlinks['wiki'] = ('https://github.com/asciimoo/searx/wiki/%s', ' ') -extlinks['pull'] = ('https://github.com/asciimoo/searx/pull/%s', 'PR ') +extlinks['wiki'] = ('https://github.com/searx/searx/wiki/%s', '%s') +extlinks['pull'] = ('https://github.com/searx/searx/pull/%s', 'PR %s') # links to custom brand -extlinks['origin'] = (GIT_URL + '/blob/master/%s', 'git://') -extlinks['patch'] = (GIT_URL + '/commit/%s', '#') -extlinks['search'] = (SEARX_URL + '/%s', '#') -extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ') -extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ') -extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '') +extlinks['origin'] = (brand.GIT_URL + '/blob/' + brand.GIT_BRANCH + '/%s', 'Origin: %s') +extlinks['patch'] = (brand.GIT_URL + '/commit/%s', 'path %s') +extlinks['search'] = (brand.SEARX_URL + '/%s', 'URL: %s') +extlinks['docs'] = (brand.DOCS_URL + '/%s', 'docs: %s') +extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: %s') +extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', 'man: %s') #extlinks['role'] = ( # 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '') extlinks['duref'] = ( - 'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '') + 'https://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '%s') extlinks['durole'] = ( - 'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '') + 'https://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '%s') extlinks['dudir'] = ( - 'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '') + 'https://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '%s') extlinks['ctan'] = ( - 'https://ctan.org/pkg/%s', 'CTAN: ') + 'https://ctan.org/pkg/%s', 'CTAN: %s') extensions = [ 'sphinx.ext.imgmath', @@ -60,7 +67,9 @@ extensions = [ "sphinx.ext.intersphinx", "pallets_sphinx_themes", "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst - "sphinxcontrib.jinja", # https://github.com/tardyp/sphinx-jinja + "sphinx_jinja", # https://github.com/tardyp/sphinx-jinja + "sphinxcontrib.programoutput", # https://github.com/NextThought/sphinxcontrib-programoutput + 'linuxdoc.kernel_include', # Implementation of the 'kernel-include' reST-directive. 'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive. 'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling. "sphinx_tabs.tabs", # https://github.com/djungelorm/sphinx-tabs @@ -75,11 +84,12 @@ intersphinx_mapping = { "sphinx" : ("https://www.sphinx-doc.org/en/master/", None), } -issues_github_path = "asciimoo/searx" +issues_github_path = "searx/searx" # HTML ----------------------------------------------------------------- sys.path.append(os.path.abspath('_themes')) +sys.path.insert(0, os.path.abspath("../utils/")) html_theme_path = ['_themes'] html_theme = "searx" @@ -90,14 +100,21 @@ imgmath_font_size = 14 # sphinx.ext.imgmath setup END html_theme_options = {"index_sidebar_logo": True} -html_context = { - "project_links": [ - ProjectLink("Source", GIT_URL), - ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"), - ProjectLink("Public instances", "https://asciimoo.github.io/searx/user/public_instances.html"), - ProjectLink("Twitter", "https://twitter.com/Searx_engine"), - ] -} +html_context = {"project_links": [] } +html_context["project_links"].append(ProjectLink("Blog", "blog/index.html")) +if brand.GIT_URL: + html_context["project_links"].append(ProjectLink("Source", brand.GIT_URL)) +if brand.WIKI_URL: + html_context["project_links"].append(ProjectLink("Wiki", brand.WIKI_URL)) +if brand.PUBLIC_INSTANCES: + html_context["project_links"].append(ProjectLink("Public instances", brand.PUBLIC_INSTANCES)) +if brand.TWITTER_URL: + html_context["project_links"].append(ProjectLink("Twitter", brand.TWITTER_URL)) +if brand.ISSUE_URL: + html_context["project_links"].append(ProjectLink("Issue Tracker", brand.ISSUE_URL)) +if brand.CONTACT_URL: + html_context["project_links"].append(ProjectLink("Contact", brand.CONTACT_URL)) + html_sidebars = { "**": ["project.html", "relations.html", "searchbox.html"], } |