conf.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
  27. extensions = [
  28. 'sphinx.ext.extlinks',
  29. 'sphinx.ext.viewcode',
  30. "sphinx.ext.autodoc",
  31. "sphinx.ext.intersphinx",
  32. "pallets_sphinx_themes",
  33. "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
  34. ]
  35. intersphinx_mapping = {
  36. "python": ("https://docs.python.org/3/", None),
  37. # "flask": ("https://flask.palletsprojects.com/", None),
  38. # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
  39. # "jinja": ("https://jinja.palletsprojects.com/", None),
  40. }
  41. issues_github_path = "asciimoo/searx"
  42. # HTML -----------------------------------------------------------------
  43. sys.path.append(os.path.abspath('_themes'))
  44. html_theme_path = ['_themes']
  45. html_theme = "searx"
  46. html_theme_options = {"index_sidebar_logo": True}
  47. html_context = {
  48. "project_links": [
  49. ProjectLink("Source", GIT_URL),
  50. ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
  51. ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
  52. ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
  53. ]
  54. }
  55. html_sidebars = {
  56. "**": ["project.html", "relations.html", "searchbox.html"],
  57. }
  58. singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
  59. html_static_path = ["static"]
  60. html_logo = "static/img/searx_logo_small.png"
  61. html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
  62. html_show_sourcelink = False
  63. # LaTeX ----------------------------------------------------------------
  64. latex_documents = [
  65. (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
  66. ]