conf.py 4.1 KB

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