conf.py 4.1 KB

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