conf.py 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. extlinks['ctan'] = (
  43. 'https://ctan.org/pkg/%s', 'CTAN: ')
  44. extensions = [
  45. 'sphinx.ext.imgmath',
  46. 'sphinx.ext.extlinks',
  47. 'sphinx.ext.viewcode',
  48. "sphinx.ext.autodoc",
  49. "sphinx.ext.intersphinx",
  50. "pallets_sphinx_themes",
  51. "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
  52. "sphinxcontrib.jinja", # https://github.com/tardyp/sphinx-jinja
  53. 'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive.
  54. 'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling.
  55. "sphinx_tabs.tabs", # https://github.com/djungelorm/sphinx-tabs
  56. ]
  57. intersphinx_mapping = {
  58. "python": ("https://docs.python.org/3/", None),
  59. "flask": ("https://flask.palletsprojects.com/", None),
  60. # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
  61. "jinja": ("https://jinja.palletsprojects.com/", None),
  62. "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
  63. "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
  64. }
  65. issues_github_path = "asciimoo/searx"
  66. # HTML -----------------------------------------------------------------
  67. sys.path.append(os.path.abspath('_themes'))
  68. html_theme_path = ['_themes']
  69. html_theme = "searx"
  70. # sphinx.ext.imgmath setup
  71. html_math_renderer = 'imgmath'
  72. imgmath_image_format = 'svg'
  73. imgmath_font_size = 14
  74. # sphinx.ext.imgmath setup END
  75. html_theme_options = {"index_sidebar_logo": True}
  76. html_context = {
  77. "project_links": [
  78. ProjectLink("Source", GIT_URL),
  79. ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
  80. ProjectLink("Public instances", "https://asciimoo.github.io/searx/user/public_instances.html"),
  81. ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
  82. ]
  83. }
  84. html_sidebars = {
  85. "**": ["project.html", "relations.html", "searchbox.html"],
  86. }
  87. singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
  88. html_static_path = ["static"]
  89. html_logo = "static/img/searx_logo_small.png"
  90. html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
  91. html_show_sourcelink = False
  92. # LaTeX ----------------------------------------------------------------
  93. latex_documents = [
  94. (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
  95. ]