conf.py 2.6 KB

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