conf.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. numfig = True
  18. from searx import webapp
  19. jinja_contexts = {
  20. 'webapp': dict(**webapp.__dict__)
  21. }
  22. # usage:: lorem :patch:`f373169` ipsum
  23. extlinks = {}
  24. # upstream links
  25. extlinks['wiki'] = ('https://github.com/asciimoo/searx/wiki/%s', ' ')
  26. extlinks['pull'] = ('https://github.com/asciimoo/searx/pull/%s', 'PR ')
  27. # links to custom brand
  28. extlinks['origin'] = (GIT_URL + '/blob/master/%s', 'git://')
  29. extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
  30. extlinks['search'] = (SEARX_URL + '/%s', '#')
  31. extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
  32. extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
  33. extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
  34. #extlinks['role'] = (
  35. # 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '')
  36. extlinks['duref'] = (
  37. 'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '')
  38. extlinks['durole'] = (
  39. 'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '')
  40. extlinks['dudir'] = (
  41. 'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '')
  42. extensions = [
  43. 'sphinx.ext.extlinks',
  44. 'sphinx.ext.viewcode',
  45. "sphinx.ext.autodoc",
  46. "sphinx.ext.intersphinx",
  47. "pallets_sphinx_themes",
  48. "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
  49. "sphinxcontrib.jinja", # https://github.com/tardyp/sphinx-jinja
  50. 'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive.
  51. 'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling.
  52. "sphinx_tabs.tabs", # https://github.com/djungelorm/sphinx-tabs
  53. ]
  54. intersphinx_mapping = {
  55. "python": ("https://docs.python.org/3/", None),
  56. "flask": ("https://flask.palletsprojects.com/", None),
  57. # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
  58. "jinja": ("https://jinja.palletsprojects.com/", None),
  59. "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
  60. "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
  61. }
  62. issues_github_path = "asciimoo/searx"
  63. # HTML -----------------------------------------------------------------
  64. sys.path.append(os.path.abspath('_themes'))
  65. html_theme_path = ['_themes']
  66. html_theme = "searx"
  67. html_theme_options = {"index_sidebar_logo": True}
  68. html_context = {
  69. "project_links": [
  70. ProjectLink("Source", GIT_URL),
  71. ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
  72. ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
  73. ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
  74. ]
  75. }
  76. html_sidebars = {
  77. "**": ["project.html", "relations.html", "searchbox.html"],
  78. }
  79. singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
  80. html_static_path = ["static"]
  81. html_logo = "static/img/searx_logo_small.png"
  82. html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
  83. html_show_sourcelink = False
  84. # LaTeX ----------------------------------------------------------------
  85. latex_documents = [
  86. (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
  87. ]