conf.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. ]
  53. intersphinx_mapping = {
  54. "python": ("https://docs.python.org/3/", None),
  55. "flask": ("https://flask.palletsprojects.com/", None),
  56. # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
  57. "jinja": ("https://jinja.palletsprojects.com/", None),
  58. "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
  59. "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
  60. }
  61. issues_github_path = "asciimoo/searx"
  62. # HTML -----------------------------------------------------------------
  63. sys.path.append(os.path.abspath('_themes'))
  64. html_theme_path = ['_themes']
  65. html_theme = "searx"
  66. html_theme_options = {"index_sidebar_logo": True}
  67. html_context = {
  68. "project_links": [
  69. ProjectLink("Source", GIT_URL),
  70. ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
  71. ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
  72. ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
  73. ]
  74. }
  75. html_sidebars = {
  76. "**": ["project.html", "relations.html", "searchbox.html"],
  77. }
  78. singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
  79. html_static_path = ["static"]
  80. html_logo = "static/img/searx_logo_small.png"
  81. html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
  82. html_show_sourcelink = False
  83. # LaTeX ----------------------------------------------------------------
  84. latex_documents = [
  85. (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
  86. ]