conf.py 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # -*- coding: utf-8 -*-
  2. import sys, os
  3. from searx.version import VERSION_STRING
  4. from pallets_sphinx_themes import ProjectLink
  5. GIT_URL = os.environ.get("GIT_URL", "https://github.com/asciimoo/searx")
  6. SEARX_URL = os.environ.get("SEARX_URL", "https://searx.me")
  7. DOCS_URL = os.environ.get("DOCS_URL", "https://asciimoo.github.io/searx/")
  8. # Project --------------------------------------------------------------
  9. project = u'searx'
  10. copyright = u'2015-2019, Adam Tauber, Noémi Ványi'
  11. author = u'Adam Tauber'
  12. release, version = VERSION_STRING, VERSION_STRING
  13. # General --------------------------------------------------------------
  14. master_doc = "index"
  15. source_suffix = '.rst'
  16. # usage:: lorem :patch:`f373169` ipsum
  17. extlinks = {}
  18. # upstream links
  19. extlinks['wiki'] = ('https://github.com/asciimoo/searx/wiki/%s', ' ')
  20. extlinks['pull'] = ('https://github.com/asciimoo/searx/pull/%s', 'PR ')
  21. # links to custom brand
  22. extlinks['origin'] = (GIT_URL + '/blob/master/%s', 'git://')
  23. extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
  24. extlinks['search'] = (SEARX_URL + '/%s', '#')
  25. extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
  26. extensions = [
  27. 'sphinx.ext.extlinks',
  28. 'sphinx.ext.viewcode',
  29. "sphinx.ext.autodoc",
  30. "sphinx.ext.intersphinx",
  31. "pallets_sphinx_themes",
  32. "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
  33. ]
  34. intersphinx_mapping = {
  35. "python": ("https://docs.python.org/3/", None),
  36. # "flask": ("https://flask.palletsprojects.com/", None),
  37. # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
  38. # "jinja": ("https://jinja.palletsprojects.com/", None),
  39. }
  40. issues_github_path = "asciimoo/searx"
  41. # HTML -----------------------------------------------------------------
  42. sys.path.append(os.path.abspath('_themes'))
  43. html_theme_path = ['_themes']
  44. html_theme = "searx"
  45. html_theme_options = {"index_sidebar_logo": True}
  46. html_context = {
  47. "project_links": [
  48. ProjectLink("Source", GIT_URL),
  49. ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
  50. ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
  51. ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
  52. ]
  53. }
  54. html_sidebars = {
  55. "**": ["project.html", "relations.html", "searchbox.html"],
  56. }
  57. singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
  58. html_static_path = ["static"]
  59. html_logo = "static/img/searx_logo_small.png"
  60. html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
  61. html_show_sourcelink = False
  62. # LaTeX ----------------------------------------------------------------
  63. latex_documents = [
  64. (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
  65. ]