conf.py 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. highlight_language = 'none'
  14. # General --------------------------------------------------------------
  15. master_doc = "index"
  16. source_suffix = '.rst'
  17. # usage:: lorem :patch:`f373169` ipsum
  18. extlinks = {}
  19. # upstream links
  20. extlinks['wiki'] = ('https://github.com/asciimoo/searx/wiki/%s', ' ')
  21. extlinks['pull'] = ('https://github.com/asciimoo/searx/pull/%s', 'PR ')
  22. # links to custom brand
  23. extlinks['origin'] = (GIT_URL + '/blob/master/%s', 'git://')
  24. extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
  25. extlinks['search'] = (SEARX_URL + '/%s', '#')
  26. extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
  27. extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
  28. extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
  29. extlinks['duref'] = (
  30. 'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '')
  31. extlinks['durole'] = (
  32. 'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '')
  33. extlinks['dudir'] = (
  34. 'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '')
  35. extensions = [
  36. 'sphinx.ext.extlinks',
  37. 'sphinx.ext.viewcode',
  38. "sphinx.ext.autodoc",
  39. "sphinx.ext.intersphinx",
  40. "pallets_sphinx_themes",
  41. "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
  42. ]
  43. intersphinx_mapping = {
  44. "python": ("https://docs.python.org/3/", None),
  45. "flask": ("https://flask.palletsprojects.com/", None),
  46. # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
  47. "jinja": ("https://jinja.palletsprojects.com/", None),
  48. }
  49. issues_github_path = "asciimoo/searx"
  50. # HTML -----------------------------------------------------------------
  51. sys.path.append(os.path.abspath('_themes'))
  52. html_theme_path = ['_themes']
  53. html_theme = "searx"
  54. html_theme_options = {"index_sidebar_logo": True}
  55. html_context = {
  56. "project_links": [
  57. ProjectLink("Source", GIT_URL),
  58. ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
  59. ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
  60. ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
  61. ]
  62. }
  63. html_sidebars = {
  64. "**": ["project.html", "relations.html", "searchbox.html"],
  65. }
  66. singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
  67. html_static_path = ["static"]
  68. html_logo = "static/img/searx_logo_small.png"
  69. html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
  70. html_show_sourcelink = False
  71. # LaTeX ----------------------------------------------------------------
  72. latex_documents = [
  73. (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
  74. ]